-
Notifications
You must be signed in to change notification settings - Fork 12
41 lines (37 loc) · 1.43 KB
/
cypress-staging.yaml
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
name: Cypress staging a11y tests
on:
schedule:
- cron: 0 */3 * * *
defaults:
run:
shell: bash
jobs:
cypress-tests:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 16.x
- name: Write the cypress.env.json file
# use quotes around the secret, as its value
# is simply inserted as a string into the command
run: |
echo '${{ secrets.CYPRESS_ENV_JSON }}' > tests_cypress/cypress.env.json
- name: Run the cypress tests
uses: cypress-io/github-action@d79d2d530a66e641eb4a5f227e13bc985c60b964 # v4.2.2
with:
record: false
config: video=false,screenshotOnRunFailure=false
build: npx cypress info
working-directory: tests_cypress
spec: |
cypress/e2e/admin/a11y/app_pages.cy.js
cypress/e2e/admin/a11y/gca_pages.cy.js
- name: Notify Slack channel if this job failed
if: ${{ failure() }}
run: |
json="{'text':'<!here> Staging a11y tests failed: <https://github.com/cds-snc/notification-admin/actions/runs/${GITHUB_RUN_ID}|see failure details> !'}"
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_WEBHOOK }}