test: add e2e tests #1
Workflow file for this run
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: End-to-end tests | |
on: push | |
env: | |
# a list of apps to build and publish on releases | |
APP_NAMES: datahub-e2e,metadata-editor-e2e | |
jobs: | |
cypress-run: | |
name: Cypress test | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node18.12.0-chrome107 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
- name: Cache Cypress binary | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/package-lock.json') }} | |
- name: Build the backend | |
run: docker compose up -f support-services/docker-compose.yml -d | |
- name: Test backend | |
run: docker run --network container:webapp-frontend appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8080/ | |
- name: install dependencies and verify Cypress | |
env: | |
# make sure every Cypress install prints minimal information | |
CI: 1 | |
run: | | |
cat support-services/.env | |
npm ci | |
npx cypress verify | |
npx cypress info | |
npx cypress version | |
- name: Cypress tests | |
run: npx nx run-many --projects=${{ env.APP_NAMES }} --target=e2e | |