-
Notifications
You must be signed in to change notification settings - Fork 14
114 lines (107 loc) · 3.41 KB
/
all_tests.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
112
113
# SPDX-FileCopyrightText: 2022 - 2023 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2022 - 2023 dv4all
# SPDX-FileCopyrightText: 2022 - 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2022 - 2024 Netherlands eScience Center
#
# SPDX-License-Identifier: Apache-2.0
name: all tests
on:
workflow_dispatch:
jobs:
fe-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "install node v20.10 and cache npm"
uses: actions/setup-node@v4
with:
node-version: 20.10
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: "install dependencies"
working-directory: frontend
run: npm ci
- name: "run unit test"
working-directory: frontend
run: npm run test:coverage
- name: "run build test"
working-directory: frontend
run: npm run build
api-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "backend tests with docker compose"
working-directory: backend-tests
run: |
docker compose up \
--exit-code-from postgrest-tests
scrapers-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: "Maven JUnit tests"
working-directory: scrapers
run: |
mvn test
e2e-chrome:
# wait fe test to finish first
needs: fe-tests
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.10
cache: 'npm'
cache-dependency-path: e2e/package-lock.json
- name: get playwright version
id: playwright-version
working-directory: e2e
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
- name: cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: install dependencies
working-directory: e2e
run: npm ci
- name: install browsers
working-directory: e2e
run: npx playwright install chromium chrome --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: build rsd
working-directory: .
run: |
cp e2e/.env.e2e .env
docker compose build --parallel database backend auth frontend documentation nginx
- name: start rsd
working-directory: .
run: |
docker compose up --detach database backend auth frontend nginx documentation swagger
sleep 10
- name: run e2e tests in chrome
working-directory: e2e
run: npm run e2e:chrome:action
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v4
if: failure()
with:
name: browser state and .env file
path: |
e2e/state/
.env
retention-days: 30