Changeset 14014 for trunk/.github/workflows/unit-tests.yml
- Timestamp:
- 09/02/2024 10:45:11 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/unit-tests.yml
r13969 r14014 1 name: Unit Tests2 3 on:4 pull_request:5 paths-ignore:6 - 'docs/**'7 push:8 branches: [ master ]9 paths-ignore:10 - 'docs/**'11 12 jobs:13 tests:14 name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }}"15 runs-on: ubuntu-latest16 strategy:17 fail-fast: false18 matrix:19 php: ['7.4', '8.0', '8.1', '8.2', '8.3']20 wp_version: ['master']21 include:22 - php: '8.0'23 wp_version: 'latest'24 - php: '7.4'25 wp_version: 'latest'26 - php: '7.4'27 wp_version: '6.1'28 env:29 WP_ENV_PHP_VERSION: ${{ matrix.php }}30 WP_VERSION: ${{ matrix.wp_version }}31 32 steps:33 - name: Cancel previous runs of this workflow34 uses: styfle/cancel-workflow-action@0.12.135 with:36 access_token: ${{ github.token }}37 38 - name: Checkout repository39 uses: actions/checkout@v440 41 - name: Check Gitignored files42 run: if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi43 44 - name: Setup PHP45 uses: shivammathur/setup-php@v246 with:47 php-version: ${{ matrix.php }}48 extensions: gd, imagick, mysql, zip49 coverage: none50 tools: composer:v251 52 - name: Set up Node.js53 uses: actions/setup-node@v454 with:55 node-version: '>=20.10.0'56 57 - name: Log information58 run: |59 echo "$GITHUB_REF"60 echo "$GITHUB_EVENT_NAME"61 npm --version62 node --version63 git --version64 php --version65 composer --version66 67 - name: Install Composer dependencies68 uses: ramsey/composer-install@v369 70 - name: Cache node modules71 uses: actions/cache@v472 env:73 cache-name: cache-node-modules74 with:75 # npm cache files are stored in `~/.npm` on Linux/macOS76 path: ~/.npm77 key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}78 restore-keys: |79 ${{ runner.os }}-build-${{ env.cache-name }}-80 ${{ runner.os }}-build-81 ${{ runner.os }}-82 83 - name: Validate node modules84 run: if [[ -f package.json ]]; then npm audit --audit-level=high --production --cache ~/.npm; fi85 86 - name: Install node modules87 run: npm ci --cache ~/.npm88 89 - name: Setup WordPress90 run: |91 if [ ${{ env.WP_VERSION }} == 'latest' ]; then92 echo "{\"core\":null}" >> .wp-env.override.json93 else94 echo "{\"core\":\"WordPress/WordPress#${WP_VERSION}\"}" >> .wp-env.override.json95 fi96 97 - name: Install WordPress98 run: |99 chmod -R 767 ./100 npm run wp-env start -- --update101 102 - name: Running single site unit tests103 if: ${{ success() || failure() }}104 run: npm run test-php105 106 - name: Running multi site unit tests107 if: ${{ success() || failure() }}108 run: npm run test-php-multisite109 110 - name: Stop Docker environment111 if: ${{ success() || failure() }}112 run: npm run wp-env stop
Note: See TracChangeset
for help on using the changeset viewer.