Merge pull request #637 from solita/renovate-fix/flyway #1947
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: E2E Cypress CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# Buildx supports GH Actions cache. Build images using it, and load the images to host for docker compose to use | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build backend | |
uses: docker/[email protected] | |
with: | |
context: etp-core/etp-backend | |
cache-from: type=gha,scope=backend | |
cache-to: type=gha,mode=max,scope=backend | |
load: true | |
- name: Build migration runner | |
uses: docker/[email protected] | |
with: | |
context: etp-core/etp-db | |
cache-from: type=gha,scope=db | |
cache-to: type=gha,mode=max,scope=db | |
load: true | |
- name: Build frontend | |
uses: docker/[email protected] | |
with: | |
context: etp-front | |
file: etp-front/e2e.Dockerfile | |
cache-from: type=gha,scope=frontend | |
cache-to: type=gha,mode=max,scope=frontend | |
load: true | |
- name: Build sftp | |
uses: docker/[email protected] | |
with: | |
context: etp-core/docker/sftp | |
cache-from: type=gha,scope=sftp | |
cache-to: type=gha,mode=max,scope=sftp | |
load: true | |
- name: Build smtp | |
uses: docker/[email protected] | |
with: | |
context: etp-core/docker/smtp | |
cache-from: type=gha,scope=smtp | |
cache-to: type=gha,mode=max,scope=smtp | |
load: true | |
- name: Setup e2e-env | |
working-directory: e2e-tests/cypress | |
run: | | |
mkdir -p /home/runner/work/ara-etp/ara-etp/etp-core/docker/smtp/received-emails | |
./start-e2e-env.sh | |
- name: Cypress | |
uses: cypress-io/github-action@v6 | |
with: | |
working-directory: e2e-tests/cypress | |
wait-on: 'https://localhost:3009' | |
env: | |
NODE_TLS_REJECT_UNAUTHORIZED: 0 | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: e2e-tests/cypress/cypress/screenshots | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-videos | |
path: e2e-tests/cypress/cypress/videos | |
- name: Collect docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 | |
with: | |
dest: './logs' | |
- name: Tar logs | |
if: failure() | |
run: tar cvzf ./logs.tgz ./logs | |
- name: Upload logs to GitHub | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs.tgz | |
path: ./logs.tgz | |
format: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: e2e-tests/cypress | |
strategy: | |
matrix: | |
node-version: [ 20.x ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: e2e-tests/cypress/package-lock.json | |
- run: npm ci | |
- run: npm run format:check |