-
Notifications
You must be signed in to change notification settings - Fork 14
98 lines (81 loc) · 2.9 KB
/
test_e2e_portalicious.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
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: 'Test: E2E (Portalicious)'
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/test_e2e_portalicious.yml'
- 'e2e/**'
- 'services/.env.example'
- 'services/**'
- '!services/**.test.ts'
- '!services/**.spec.ts'
- 'interfaces/Portalicious/**'
- '!interfaces/Portalicious/**.test.ts'
- '!interfaces/Portalicious/**.spec.ts'
- '!**.md'
env:
e2eTestsPath: './e2e'
jobs:
test:
runs-on: ubuntu-latest
environment: test
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
node-version-file: '${{ env.e2eTestsPath }}/.node-version'
cache: 'npm'
cache-dependency-path: '${{ env.e2eTestsPath }}/package-lock.json'
- name: Install E2E-Tests code-dependencies
working-directory: ${{ env.e2eTestsPath }}
run: |
npm ci --no-fund --no-audit
- name: Lint E2E-Tests code
working-directory: ${{ env.e2eTestsPath }}
run: 'npm run lint'
- name: Set ENV-variables for test-environment
run: |
cp services/.env.example services/.env
- name: Run Services with Docker
working-directory: ./services
run: |
docker --log-level 'warn' compose -f docker-compose.yml up -d --quiet-pull --wait --wait-timeout 300
- name: Start Portalicious
working-directory: ./interfaces/Portalicious
env:
NG_URL_121_SERVICE_API: http://localhost:3000/api
run: |
npm install
npm run start:debug-production > portalicious-server-logs.txt 2>&1 &
- name: Install 121-Service dependencies
# This step is necessary because the tests run functions in this folder
working-directory: ./services/121-service
run: |
npm install
- name: Install E2E-Tests runtime-dependencies
working-directory: ${{ env.e2eTestsPath }}
run: |
npx playwright install chromium --with-deps
- name: Wait for Portalicious
run: |
timeout 90s sh -c 'until curl http://localhost:8088 -I; do echo "Waiting for Portalicious to be running..."; sleep 1; done'
- name: Run E2E-Tests with Playwright
working-directory: ${{ env.e2eTestsPath }}
env:
BASE_URL_PORTALICIOUS: http://localhost:8088
run: |
npm run test:portalicious
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-result-artifacts
path: |
${{ env.e2eTestsPath }}/test-results/
./interfaces/Portalicious/portalicious-server-logs.txt
retention-days: 30
- name: Docker logs
if: always()
uses: jwalton/gh-docker-logs@v2