Running e2e tests #576
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: run-e2e | |
run-name: Running e2e tests | |
on: | |
push: | |
branches: | |
- '**' | |
workflow_dispatch: | |
branches: | |
- main | |
schedule: | |
# run every at every minute 25 of every hour monday to friday | |
- cron: '25 * * * 1-5' | |
# run at 00:25 and 12:25 on saturday and sunday | |
- cron: '25 0,12 * * 0,6' | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Install npm dependencies, cache them correctly and run all Cypress tests | |
- name: Cypress run | |
id: cypress | |
uses: cypress-io/github-action@v6 | |
with: | |
install-command: yarn install | |
env: | |
CYPRESS_BEARER_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
CYPRESS_NUA_KEY: ${{ secrets.NUA_KEY }} | |
CYPRESS_USER_NAME: ${{ secrets.USER_NAME }} | |
CYPRESS_USER_PWD: ${{ secrets.USER_PWD }} | |
# after the test run completes store reports and any screenshots | |
- name: Cypress reports | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() && steps.cypress.conclusion == 'failure' }} | |
with: | |
name: cypress-reports | |
path: cypress/reports | |
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | |
- name: Discord notification | |
uses: cl8dep/[email protected] | |
if: ${{ failure() && steps.cypress.conclusion == 'failure' && github.ref_name == 'main' }} | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK_APPLICATION }} | |
message: | | |
⚠️ tests failed | |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
username: 'Cypress E2E' |