Skip to content

Commit ce4ad75

Browse files
committed
ci: enable cross-testing with db2
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
1 parent f96e589 commit ce4ad75

4 files changed

Lines changed: 5894 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# SPDX-License-Identifier: MIT
2+
# SPDX-FileCopyrightText: Copyright 2024 LoopBack contributors
3+
name: CI
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
13+
permissions: {}
14+
15+
jobs:
16+
code-lint:
17+
name: Code lint
18+
runs-on: ubuntu-24.04
19+
timeout-minutes: 5
20+
steps:
21+
- name: Harden runner
22+
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
23+
with:
24+
egress-policy: audit
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
fetch-depth: 0
28+
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
29+
with:
30+
node-version: 22
31+
cache: npm
32+
- name: Bootstrap dependencies
33+
run: npm ci --ignore-scripts
34+
- name: Verify code linting
35+
run: npm run lint --ignore-scripts
36+
commit-lint:
37+
name: Commit lint
38+
runs-on: ubuntu-24.04
39+
timeout-minutes: 5
40+
if: ${{ github.event.pull_request }}
41+
steps:
42+
- name: Harden runner
43+
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
44+
with:
45+
egress-policy: audit
46+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
fetch-depth: 0
49+
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
50+
with:
51+
node-version: 22
52+
cache: npm
53+
- name: Bootstrap dependencies
54+
run: npm ci --ignore-scripts
55+
- name: Verify Commit Linting
56+
run: |-
57+
npm exec \
58+
--no \
59+
--package=@commitlint/cli \
60+
-- \
61+
commitlint \
62+
--from=origin/master \
63+
--to=HEAD \
64+
--verbose
65+
license-lint:
66+
name: License lint
67+
runs-on: ubuntu-24.04
68+
timeout-minutes: 5
69+
steps:
70+
- name: Harden runner
71+
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
72+
with:
73+
disable-sudo: true
74+
egress-policy: block
75+
allowed-endpoints: >
76+
github.com:443
77+
- name: Checkout
78+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
79+
with:
80+
fetch-depth: 1
81+
- name: Setup REUSE tool
82+
uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4.0.0
83+
test:
84+
name: Test
85+
runs-on: ubuntu-24.04
86+
timeout-minutes: 30
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
node-version:
91+
- 16
92+
- 18
93+
- 20
94+
- 22
95+
db2-version:
96+
- :11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5
97+
steps:
98+
- name: Harden runner
99+
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
100+
with:
101+
egress-policy: audit
102+
- name: Checkout
103+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104+
with:
105+
fetch-depth: 1
106+
- name: Setup Node.js
107+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
108+
with:
109+
node-version: 22
110+
cache: npm
111+
- name: Bootstrap dependencies
112+
run: npm ci
113+
- name: Run test harness
114+
uses: ./test
115+
with:
116+
node-version: ${{ github.matrix.node-version }}
117+
db2-version: ${{ github.matrix.db2-version }}
118+
test-db2:
119+
name: Cross-test (DB2 LUW)
120+
runs-on: ubuntu-24.04
121+
timeout-minutes: 30
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
node-version:
126+
- 18
127+
- 20
128+
- 22
129+
db2-version:
130+
- :11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5
131+
steps:
132+
- name: Harden runner
133+
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
134+
with:
135+
egress-policy: audit
136+
- name: Checkout
137+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
138+
with:
139+
fetch-depth: 1
140+
- name: Setup Node.js
141+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
142+
with:
143+
node-version: 22
144+
cache: npm
145+
- name: Bootstrap dependencies
146+
run: npm ci --ignore-scripts
147+
- name: Package for cross-testing
148+
run: |-
149+
mkdir ghaction-autoinstall
150+
npm pack --pack-destination=ghaction-autoinstall
151+
- name: Run test harness
152+
uses: loopbackio/loopback-connector-db2/test@ci/ghaction-test
153+
with:
154+
node-version: ${{ github.matrix.node-version }}
155+
db2-version: ${{ github.matrix.db2-version }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
node_modules
22
.DS_Store
3+
4+
# Code editors
5+
\#*#
6+
.#*
7+
*~

0 commit comments

Comments
 (0)