Cypress staging a11y tests #1282
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: 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 }} |