-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (42 loc) · 1.5 KB
/
percy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 }}