-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (106 loc) · 3.23 KB
/
ci-e2e-cypress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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