Submit screenshots to Percy for visual regression testing. #1091
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Submit screenshots to Percy for visual regression testing. | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
inputs: {} | |
jobs: | |
percy-integration: | |
name: Percy - Nuxt Site | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/workflows/setup-workspace | |
- name: Sets env vars for PR preview | |
run: | | |
echo "ES_INDEX=${{secrets.ES_INDEX_TEST}}-percy-tests-${{ github.head_ref || github.ref_name }}" >> $GITHUB_ENV | |
if: github.ref_name!='main' | |
- name: Sets env vars for main merge | |
run: | | |
echo "ES_INDEX=${{secrets.ES_INDEX_TEST}}" >> $GITHUB_ENV | |
if: github.ref_name=='main' | |
- run: npm run generate | |
if: steps.cache-nuxt.outputs.cache-hit != 'true' | |
env: | |
CRAFT_ENDPOINT: ${{ secrets.CRAFT_ENDPOINT }} | |
LIBCAL_ENDPOINT: ${{ secrets.LIBCAL_ENDPOINT }} | |
S3_BUCKET: "https://static.library.ucla.edu/" | |
ES_URL: ${{ secrets.ES_URL }} | |
ESApiKey: ${{ secrets.ESApiKey }} | |
ES_READ_KEY: ${{ secrets.ES_READ_KEY_TEST }} | |
ES_WRITE_KEY: ${{ secrets.ES_WRITE_KEY_TEST }} | |
ES_INDEX: ${{ env.ES_INDEX }} | |
ES_INDEX_PREFIX: ${{secrets.ES_INDEX_PREFIX_TEST}} | |
LIBGUIDES_ES_INDEX: ${{secrets.LIBGUIDES_ES_INDEX_TEST}} | |
- uses: cypress-io/github-action@v3 | |
with: | |
start: npm run start | |
command-prefix: 'percy exec -- npx' | |
wait-on: http://localhost:3000 | |
env: | |
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_E2E }} |