diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000000..6370304295 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,48 @@ +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 +