Skip to content

Commit 0369081

Browse files
authored
fix: ci ok and pass loop from 90 to 20
Signed-off-by: Max Pochet <max.pochet-cic@ibm.com>
1 parent ffceb78 commit 0369081

11 files changed

Lines changed: 1516 additions & 393 deletions
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions: {}
10+
11+
jobs:
12+
test:
13+
name: Test
14+
timeout-minutes: 30
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
node-version: [20, 22, 24]
19+
fail-fast: false
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Docker
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Start DB2 container
28+
run: |
29+
docker run -itd --name db2 \
30+
--privileged=true \
31+
-e LICENSE=accept \
32+
-e DB2INST1_PASSWORD=password \
33+
-e DBNAME=testdb \
34+
-p 60000:50000 \
35+
-v db2data:/db2data \
36+
ibmcom/db2
37+
38+
- name: Wait for DB2 instance to be up
39+
run: |
40+
echo "Waiting for DB2 engine to be ready..."
41+
for i in {1..20}; do
42+
docker exec db2 su - db2inst1 -c "db2 connect to sample" >/dev/null 2>&1 && break
43+
echo "Still waiting ($i)..."
44+
sleep 5
45+
done
46+
47+
- name: Wait for testdb to be accessible
48+
run: |
49+
echo "Waiting for testdb..."
50+
for i in {1..20}; do
51+
docker exec db2 su - db2inst1 -c "db2 connect to testdb" >/dev/null 2>&1 && break
52+
echo "Still waiting ($i)..."
53+
sleep 5
54+
done
55+
56+
- name: Use Node.js ${{ matrix.node-version }}
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: ${{ matrix.node-version }}
60+
61+
- run: npm ci
62+
63+
- name: Run test
64+
run: npm test --ignore-scripts
65+
66+
- name: Dump DB2 logs on failure
67+
if: failure()
68+
run: docker logs db2
69+
70+
- name: Cleanup DB2 container
71+
if: always()
72+
run: docker rm -f db2
73+
74+
code-lint:
75+
name: Code Lint
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: actions/setup-node@v4
80+
with:
81+
node-version: 22
82+
- run: npm ci --ignore-scripts
83+
- name: Verify code linting
84+
run: npx --no eslint .
85+
86+
commit-lint:
87+
name: Commit Lint
88+
runs-on: ubuntu-latest
89+
if: ${{ github.event.pull_request }}
90+
steps:
91+
- uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0
94+
- uses: actions/setup-node@v4
95+
with:
96+
node-version: 22
97+
- run: npm ci
98+
- name: Verify commit linting
99+
run: npx commitlint --from origin/master --to HEAD --verbose

commitlint.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright IBM Corp. and LoopBack contributors 2025. All Rights Reserved.
2+
// Node module: loopback-connector-postgresql
3+
// This file is licensed under the MIT License.
4+
// License text available at https://opensource.org/licenses/MIT
5+
6+
'use strict';
7+
8+
module.exports = {
9+
extends: [
10+
'@commitlint/config-conventional',
11+
],
12+
rules: {
13+
'header-max-length': [2, 'always', 100],
14+
'body-leading-blank': [2, 'always'],
15+
'footer-leading-blank': [0, 'always'],
16+
'signed-off-by': [2, 'always', 'Signed-off-by:'],
17+
},
18+
};

lib/globalize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
'use strict';
77

8-
var path = require('path');
9-
var SG = require('strong-globalize');
8+
const path = require('path');
9+
const SG = require('strong-globalize');
1010

1111
SG.SetRootDir(path.join(__dirname, '..'), {autonomousMsgLoading: 'all'});
1212
module.exports = SG();

0 commit comments

Comments
 (0)