-
Notifications
You must be signed in to change notification settings - Fork 14
157 lines (154 loc) · 4.59 KB
/
ci.yaml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright 2024 LoopBack contributors
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions: {}
jobs:
code-lint:
name: Code lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Harden runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
cache: npm
- name: Bootstrap dependencies
run: npm ci --ignore-scripts
- name: Verify code linting
run: npm run lint --ignore-scripts
commit-lint:
name: Commit lint
runs-on: ubuntu-24.04
timeout-minutes: 5
if: ${{ github.event.pull_request }}
steps:
- name: Harden runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
cache: npm
- name: Bootstrap dependencies
run: npm ci --ignore-scripts
- name: Verify Commit Linting
run: |-
npm exec \
--no \
--package=@commitlint/cli \
-- \
commitlint \
--from=origin/master \
--to=HEAD \
--verbose
license-lint:
name: License lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Harden runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Setup REUSE tool
uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4.0.0
test:
name: Test
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
node-version:
- 16
- 18
- 20
- 22
db2-version:
- :11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5
steps:
- name: Harden runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
submodules: true
- name: Run test harness
env:
DB2_VERSION: ${{ matrix.db2-version }}
run: ./cicd/well-known/test-harness.sh
test-ibmdb:
name: Cross-test (IBM DB)
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
node-version:
- 16
- 18
- 20
- 22
db2-version:
- :11.5.9.0@sha256:77095d4e04cf4448c0257086afcb2c166193d718dc33441da3b949f97e21efd5
steps:
- name: Harden runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
path: loopback-connector-db2
- name: Prepare for cross-testing
run: |-
mkdir nodejs-autoinstall
cd loopback-connector-db2
npm ci --ignore-scripts
npm pack --pack-destination ../nodejs-autoinstall
- name: Clone IBM DB repository
run: |-
git clone --depth=1 https://github.com/loopbackio/loopback-ibmdb.git
cd loopback-ibmdb
git submodule update --init
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
cache: npm
cache-dependency-path: |-
./loopback-ibmdb/package-lock.json
./loopback-connector-db2/package-lock.json
- name: Run test harness
env:
DB2_VERSION: ${{ matrix.db2-version }}
run: ./loopback-ibmdb/cicd/well-known/test-harness.sh