Skip to content

Commit 6fd4e46

Browse files
committed
ci(ghaction): use shell script test harness
Signed-off-by: Rifa Achrinza <[email protected]>
1 parent aecb0ef commit 6fd4e46

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
- 20
9494
- 22
9595
db2-version:
96-
- :11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5
96+
- ':11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5'
9797
steps:
9898
- name: Harden runner
9999
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
@@ -103,18 +103,16 @@ jobs:
103103
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104104
with:
105105
fetch-depth: 1
106+
submodules: true
106107
- name: Setup Node.js
107108
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
108109
with:
109110
node-version: 22
110111
cache: npm
111-
- name: Bootstrap dependencies
112-
run: npm ci
113112
- name: Run test harness
114-
uses: ./test
115-
with:
116-
node-version: ${{ github.matrix.node-version }}
117-
db2-version: ${{ github.matrix.db2-version }}
113+
env:
114+
DB2_VERSION: ${{ matrix.db2-version }}
115+
run: ./cicd/well-known/test-harness.sh
118116
test-db2:
119117
name: Cross-test [IBM DB->DB2 LUW]
120118
runs-on: ubuntu-24.04
@@ -151,5 +149,5 @@ jobs:
151149
- name: Run test harness
152150
uses: loopbackio/loopback-connector-db2/test@ci/ghaction-test
153151
with:
154-
node-version: ${{ github.matrix.node-version }}
155-
db2-version: ${{ github.matrix.db2-version }}
152+
node-version: ${{ matrix.node-version }}
153+
db2-version: ${{ matrix.db2-version }}

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
branches:
2+
only:
3+
- master
14
language: node_js
2-
os:
3-
- linux
45
dist: jammy
56
arch:
67
- arm64
@@ -14,5 +15,7 @@ node_js:
1415
- 18
1516
- 20
1617
- 22
18+
env:
19+
- DB2_VERSION=:11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5
1720
install: skip
1821
script: ./cicd/well-known/test-harness.sh

cicd/well-known/test-harness.sh

100644100755
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ export DB2_HOSTNAME=localhost
88
export DB2_PORTNUM=50000
99
export DB2_DATABASE=mydb
1010

11+
ORIG_DIR="$(pwd)"
12+
cd "$(dirname "$0")/../.."
13+
BASE_DIR="$(pwd)"
14+
1115
CI_NODEJS_AUTOINSTALL_DIR="${CI_NODEJSAUTOINSTALL_DIR:-}"
12-
STARTDB2_SCRIPT="$(dirname "$0")/../vendor/setup-db2/start-db2.sh"
16+
STARTDB2_SCRIPT="$BASE_DIR/cicd/vendor/setup-db2/start-db2.sh"
1317

1418
STEP_COUNT=1
1519

1620
step () {
1721
printf "\n\n============================================================================\n"
18-
printf 'STEP #%d: %s' "$STEP_COUNT\n" "$1"
22+
printf 'STEP #%d: %s\n' "$STEP_COUNT" "$1"
1923
printf "\n============================================================================\n\n"
2024
STEP_COUNT="$((STEP_COUNT + 1))"
2125
}
@@ -34,10 +38,15 @@ fi
3438
npm install --prefer-offline
3539

3640
step 'Start DB2 LUW server'
37-
"STARTDB2_SCRIPT" \
41+
"$STARTDB2_SCRIPT" \
3842
-l accept \
3943
-V "$DB2_VERSION" \
4044
-p 'P00lGnorts'
4145

4246
step 'Run tests'
4347
npm test --ignore-scripts
48+
49+
step 'Teardown DB2 LUW server'
50+
"$STARTDB2_SCRIPT" -C
51+
52+
cd "$ORIG_DIR"

0 commit comments

Comments
 (0)