-
Notifications
You must be signed in to change notification settings - Fork 11
89 lines (77 loc) · 2.11 KB
/
continuous-integration.yml
File metadata and controls
89 lines (77 loc) · 2.11 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
name: Continuous Integration
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions: {}
jobs:
test:
name: Test
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20, 22, 24]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Start DB2 container
run: |
docker run -itd --name db2 \
--privileged=true \
-e LICENSE=accept \
-e DB2INST1_PASSWORD=password \
-e DBNAME=testdb \
-p 60000:50000 \
-v db2data:/db2data \
ibmcom/db2
- name: Wait for DB2 instance to be up
run: |
echo "Waiting for DB2 engine to be ready..."
for i in {1..20}; do
docker exec db2 su - db2inst1 -c "db2 connect to sample" >/dev/null 2>&1 && break
echo "Still waiting ($i)..."
sleep 5
done
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Run test
run: npm test --ignore-scripts
- name: Dump DB2 logs on failure
if: failure()
run: docker logs db2
- name: Cleanup DB2 container
if: always()
run: docker rm -f db2
code-lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
- run: npm ci --ignore-scripts
- name: Verify code linting
run: npx --no eslint .
commit-lint:
name: Commit Lint
runs-on: ubuntu-latest
if: ${{ github.event.pull_request }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 22
- run: npm ci
- name: Verify commit linting
run: npx commitlint --from origin/master --to HEAD --verbose