Skip to content

Bump follow-redirects from 1.15.3 to 1.15.4 #42

Bump follow-redirects from 1.15.3 to 1.15.4

Bump follow-redirects from 1.15.3 to 1.15.4 #42

Workflow file for this run

name: Test
on:
pull_request:
branches: [develop, trunk]
jobs:
changed:
outputs:
plugin: ${{ steps.plugin.outputs.any_changed }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: tj-actions/changed-files@v41
id: plugin
with:
files: |
which-blocks.php
src/**/*.php
tests/**/*
package.json
package-lock.json
composer.json
composer.lock
.wp-env.json
cache:
name: Cache the Node
needs: changed
if: ${{ needs.changed.outputs.plugin == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "node-cache-dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v3
id: npm-cache
with:
path: |
./node_modules
/home/runner/.cache/Cypress
${{ steps.npm-cache-dir.outputs.node-cache-dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
phpcs:
name: Lint PHP
needs: changed
if: ${{ needs.changed.outputs.plugin == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer install
- name: Lint PHP
run: composer run lint .
phpunit:
name: PHP Unit
needs: phpcs
if: ${{ needs.changed.outputs.plugin == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer install
- name: Lint PHP
run: composer run unit
cypress:
name: E2E ${{ matrix.core.name }}
needs: [changed, phpcs, phpunit, cache]
if: ${{ needs.changed.outputs.plugin == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP 6.0', version: 'WordPress/WordPress#6.0'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "node-cache-dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v3
id: npm-cache
with:
path: |
./node_modules
/home/runner/.cache/Cypress
${{ steps.npm-cache-dir.outputs.node-cache-dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build (optional)
run: npm run build
- name: Set the core version
run: ./tests/bin/set-core-version.js ${{ matrix.core.version }}
- name: Set up WP environment
run: npm run env:start
- name: Test
run: npm run cypress:run
- name: Update summary
run: |
npx mochawesome-merge ./tests/cypress/reports/*.json -o tests/cypress/reports/mochawesome.json
rm -rf ./tests/cypress/reports/mochawesome-*.json
npx mochawesome-json-to-md -p ./tests/cypress/reports/mochawesome.json -o ./tests/cypress/reports/mochawesome.md
npx mochawesome-report-generator tests/cypress/reports/mochawesome.json -o tests/cypress/reports/
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY
- name: Make artifacts available
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-artifact
retention-days: 2
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
${{ github.workspace }}/tests/cypress/reports/