This repository was archived by the owner on Aug 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 815
91 lines (70 loc) · 2.44 KB
/
test.yml
File metadata and controls
91 lines (70 loc) · 2.44 KB
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
name: test
on: [push, pull_request]
env:
TZ: utc
jobs:
build:
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Build for ${{ matrix.node-version }}
run: scripts/build.sh
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: built_node${{ matrix.node-version }}
path: server/public
test:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false # if one job fails, others will not be aborted
matrix:
backendtype: ['', 'mssql', 'mysql', 'mariadb', 'postgres']
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Start redis
run: docker compose -f server/docker-compose.yml up -d redis &
- name: Start ldap
run: docker compose -f server/docker-compose.yml up -d ldap &
- name: Start service for backend server
if: ${{ matrix.backendtype }}
run: docker compose -f server/docker-compose.yml up -d ${{ matrix.backendtype }} &
- name: Install node modules
run: (cd server && yarn)
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
artifact-ids: ${{ needs.build.outputs.artifact-id }}
path: server/public
- name: Verify backend DB service is healthy before starting
if: ${{ matrix.backendtype }}
run: |
until docker ps | fgrep "(healthy)" | grep ${{ matrix.backendtype }} ; do
docker ps
sleep 0.5
done
- name: Verify ldap is healthy before starting
run: |
until docker ps | fgrep "(healthy)" | grep test-openldap ; do
docker ps
sleep 0.5
done
- name: Test
run: npm run test${{ matrix.backendtype }} --prefix server