Skip to content

Commit aecb0ef

Browse files
committed
ci: add travis ci
Signed-off-by: Rifa Achrinza <[email protected]>
1 parent 8d3e281 commit aecb0ef

File tree

10 files changed

+3377
-1338
lines changed

10 files changed

+3377
-1338
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
max_line_length = 80

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
cache: npm
5353
- name: Bootstrap dependencies
5454
run: npm ci --ignore-scripts
55-
- name: Verify Commit Linting
55+
- name: Verify commit linting
5656
run: |-
5757
npm exec \
5858
--no \
@@ -116,7 +116,7 @@ jobs:
116116
node-version: ${{ github.matrix.node-version }}
117117
db2-version: ${{ github.matrix.db2-version }}
118118
test-db2:
119-
name: Cross-test (DB2 LUW)
119+
name: Cross-test [IBM DB->DB2 LUW]
120120
runs-on: ubuntu-24.04
121121
timeout-minutes: 30
122122
strategy:

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "cicd/vendor/setup-db2"]
2+
path = cicd/vendor/setup-db2
3+
url = https://github.com/achrinza/setup-db2.git
4+
branch = v0.1.0

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: node_js
2+
os:
3+
- linux
4+
dist: jammy
5+
arch:
6+
- arm64
7+
- ppc64le
8+
- s390x
9+
cache:
10+
npm: true
11+
services:
12+
- docker
13+
node_js:
14+
- 18
15+
- 20
16+
- 22
17+
install: skip
18+
script: ./cicd/well-known/test-harness.sh

cicd/vendor/setup-db2

Submodule setup-db2 added at 1ecca51
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is a dummy Dockerfile used by the `test-harness.sh` file.
2+
# This allows Renovatebot to detect and auto-update the IBM DB2 LUW image.
3+
FROM icr.io/db2_community/db2:11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5

cicd/well-known/test-harness.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
export POSIXLY_CORRECT=1
3+
set -eu
4+
5+
export DB2_USERNAME=db2inst1
6+
export DB2_PASSWORD=P00lGnorts
7+
export DB2_HOSTNAME=localhost
8+
export DB2_PORTNUM=50000
9+
export DB2_DATABASE=mydb
10+
11+
CI_NODEJS_AUTOINSTALL_DIR="${CI_NODEJSAUTOINSTALL_DIR:-}"
12+
STARTDB2_SCRIPT="$(dirname "$0")/../vendor/setup-db2/start-db2.sh"
13+
14+
STEP_COUNT=1
15+
16+
step () {
17+
printf "\n\n============================================================================\n"
18+
printf 'STEP #%d: %s' "$STEP_COUNT\n" "$1"
19+
printf "\n============================================================================\n\n"
20+
STEP_COUNT="$((STEP_COUNT + 1))"
21+
}
22+
23+
step 'Bootstrap dependencies'
24+
npm ci --prefer-offline
25+
26+
step 'Bootstrap overriding dependencies'
27+
if [ -d "$CI_NODEJS_AUTOINSTALL_DIR" ]; then
28+
find \
29+
"$CI_NODEJS_AUTOINSTALL_DIR" \
30+
-iname '*.tgz' \
31+
-exec \
32+
npm install {} \;
33+
fi
34+
npm install --prefer-offline
35+
36+
step 'Start DB2 LUW server'
37+
"STARTDB2_SCRIPT" \
38+
-l accept \
39+
-V "$DB2_VERSION" \
40+
-p 'P00lGnorts'
41+
42+
step 'Run tests'
43+
npm test --ignore-scripts

0 commit comments

Comments
 (0)