Skip to content

Infrastructure release: 1.5.7 #4471

Infrastructure release: 1.5.7

Infrastructure release: 1.5.7 #4471

Workflow file for this run

name: Cypress Tests
on:
pull_request:
branches:
- main
paths:
- "**"
- "!.devcontainer/**"
- "!.github/**"
- "!infrastructure/.devcontainer/**"
- "!infrastructure/terragrunt/**"
env:
WPML_USER_ID: ${{ secrets.WPML_USER_ID }}
WPML_KEY: ${{ secrets.WPML_KEY }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 16
- name: PHP Setup
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Add Composer auth credentials
run: |
cd wordpress
composer config github-oauth.github.com ${{ secrets.COMPOSER_GITHUB_TOKEN }}
composer config http-basic.my.yoast.com token ${{ secrets.COMPOSER_YOAST_TOKEN }}
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer install
working-directory: wordpress
run: |
composer install --prefer-dist --no-progress
composer check-platform-reqs
- name: Cache NPM
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: |
~/.npm
~/.cache/Cypress
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cypress and NPM install and build
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
with:
runTests: false
- name: Start test environment
run: |
npm run wp-env:init
npm run wp-env:test:setup
- name: Cypress run
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
with:
install: false
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: cypress-videos
path: cypress/videos