Introduce Cypress #6
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: Next.js E2E Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check: | |
name: E2E job with Cypress | |
runs-on: ubuntu-latest | |
env: | |
NEXT_PUBLIC_APP_URL: http://localhost:3000 | |
UNILOGIN_SESSION_SECRET: XXX | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 # Required to retrieve git history | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile --no-progress --non-interactive | |
- name: Build the Nextjs app and run Cypress tests | |
uses: cypress-io/github-action@v4 | |
with: | |
install: false | |
build: yarn build | |
start: yarn start | |
wait-on: http://localhost:3000 | |
runTests: yarn cypress:run | |
browser: chrome |