branch {main} commit {AUTH: force auth0 user to prompt login info again after logout} #51
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 CI | |
run-name: branch {${{ github.head_ref || github.ref_name }}} commit {${{ github.event.head_commit.message || 'pull request'}}} | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEBUG: "cypress:server:args" | |
#address of services is the name of the service if both on containers and no port map needed | |
DATABASE_URL: "mysql://root:root@mysql-service/terrarossa" | |
NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}} | |
NEXTAUTH_URL: ${{vars.NEXTAUTH_URL}} | |
AUTH0_CLIENT_ID: ${{secrets.AUTH0_CLIENT_ID}} | |
AUTH0_CLIENT_SECRET: ${{secrets.AUTH0_CLIENT_SECRET}} | |
AUTH0_ISSUER: ${{vars.AUTH0_ISSUER}} | |
AUTH_BASE_URL: ${{vars.AUTH_BASE_URL}} | |
CYPRESS_AUTH0_USER: ${{secrets.CYPRESS_AUTH0_USER}} | |
CYPRESS_AUTH0_PW: ${{secrets.CYPRESS_AUTH0_PW}} | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
NODE_ENV: "test" | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cypress install | |
uses: cypress-io/github-action@v5 | |
with: | |
build: npm run build | |
runTests: false | |
- name: Save build folder | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
if-no-files-found: error | |
path: .next | |
ui-chrome-tests: | |
needs: install | |
runs-on: ubuntu-latest | |
services: | |
mysql-service: | |
image: mysql:latest | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: terrarossa | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
container: | |
image: cypress/browsers:latest | |
strategy: | |
fail-fast: false | |
matrix: | |
containers: [1, 2, 3] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download the build folders | |
uses: actions/download-artifact@v3 | |
with: | |
name: build | |
path: .next | |
- name: "UI Tests - Chrome" | |
uses: cypress-io/github-action@v5 | |
with: | |
#use build step to seed the database, build is already done in install job | |
build: npm run db:seed | |
start: npm start | |
wait-on: "http://localhost:3000" | |
wait-on-timeout: 120 | |
browser: chrome | |
record: true | |
parallel: true | |
group: "UI - Chrome" | |
config-file: cypress.config.ts | |
ui-chrome-mobile-tests: | |
needs: install | |
runs-on: ubuntu-latest | |
services: | |
mysql-service: | |
image: mysql:latest | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: terrarossa | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
container: | |
image: cypress/browsers:latest | |
strategy: | |
fail-fast: false | |
matrix: | |
containers: [1, 2, 3] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download the build folders | |
uses: actions/download-artifact@v3 | |
with: | |
name: build | |
path: .next | |
- name: "UI Tests - Chrome - Mobile" | |
uses: cypress-io/github-action@v5 | |
with: | |
config: "viewportWidth=375,viewportHeight=667" | |
#use build step to seed the database, build is already done in install job | |
build: npm run db:seed | |
start: npm start | |
wait-on: "http://localhost:3000" | |
wait-on-timeout: 120 | |
browser: chrome | |
record: true | |
parallel: true | |
group: "UI - Chrome - Mobile" | |
config-file: cypress.config.ts | |
component-testing: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download the build folders | |
uses: actions/download-artifact@v3 | |
with: | |
name: build | |
path: .next | |
- name: Run Component Testing | |
uses: cypress-io/github-action@v5 | |
with: | |
component: true | |
config-file: cypress.config.ts |