Skip to content

Commit dc5f860

Browse files
committed
ci: fix script
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
1 parent d5954fe commit dc5f860

4 files changed

Lines changed: 35 additions & 14 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ jobs:
137137
fetch-depth: 1
138138
submodules: true
139139
path: loopback-ibmdb
140-
- name: Bootstrap dependencies
141-
run: npm ci --ignore-scripts
142-
- name: Package for cross-testing
143-
run: |
144-
mkdir ghaction-autoinstall
145-
npm pack --pack-destination=ghaction-autoinstall
146140
- name: Clone DB2 connector repository
147141
run: |
148142
git clone \
@@ -159,10 +153,14 @@ jobs:
159153
cache-dependency-path: |
160154
./loopback-connector-db2/package-lock.json
161155
./loopback-ibmdb/package-lock.json
156+
- name: Bootstrap dependencies
157+
run: |
158+
cd loopback-ibmdb
159+
npm ci --ignore-scripts
162160
- name: Setup and run test harness
163161
env:
164162
DB2_VERSION: ${{ matrix.db2-version }}
165163
run: |
166164
./loopback-ibmdb/cicd/well-known/prepare-autoinstall.sh
167-
. /loopback-ibmdb/cicd/tmp/well-known/set-env/post-prepare-autoinstall.sh
165+
. ./loopback-ibmdb/cicd/tmp/well-known/set-env/post-prepare-autoinstall.sh
168166
./loopback-connector-db2/cicd/well-known/test-harness.sh

cicd/well-known/prepare-autoinstall.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# SPDX-FileCopyrightText: Copyright 2024 LoopBack contributors
3+
# SPDX-License-Identifier: MIT
24
export POSIXLY_CORRECT=1
35
set -euv
46

cicd/well-known/test-harness.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# SPDX-FileCopyrightText: Copyright 2024 LoopBack contributors
3+
# SPDX-License-Identifier: MIT
24
export POSIXLY_CORRECT=1
35
set -euv
46

@@ -12,7 +14,7 @@ ORIG_DIR="$(pwd)"
1214
cd "$(dirname "$0")/../.."
1315
BASE_DIR="$(pwd)"
1416

15-
CI_NODEJS_AUTOINSTALL_DIR="${CI_NODEJSAUTOINSTALL_DIR:-}"
17+
CI_NODEJS_AUTOINSTALL_DIR="${CI_NODEJS_AUTOINSTALL_DIR:-}"
1618
STARTDB2_SCRIPT="$BASE_DIR/cicd/vendor/setup-db2/start-db2.sh"
1719

1820
STEP_COUNT=1
@@ -28,12 +30,14 @@ step 'Bootstrap dependencies'
2830
npm ci --prefer-offline
2931

3032
step 'Bootstrap overriding dependencies'
31-
if [ -d "$CI_NODEJS_AUTOINSTALL_DIR" ]; then
32-
find \
33-
"$CI_NODEJS_AUTOINSTALL_DIR" \
34-
-iname '*.tgz' \
35-
-exec \
36-
npm install {} \;
33+
if [ "$CI_NODEJS_AUTOINSTALL_DIR" != '' ]; then
34+
printf "$CI_NODEJS_AUTOINSTALL_DIR" |
35+
xargs -d: \
36+
find \
37+
"$CI_NODEJS_AUTOINSTALL_DIR" \
38+
-iname '*.tgz' \
39+
-exec \
40+
npm install {} \;
3741
fi
3842
npm install --prefer-offline
3943

commitlint.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-FileCopyrightText: Copyright 2024 LoopBack contributors
2+
// SPDX-License-Identifier: MIT
3+
'use strict';
4+
5+
const isCI = process.env.CI;
6+
7+
module.exports = {
8+
extends: ['@commitlint/config-conventional'],
9+
rules: {
10+
'header-max-length': [2, 'always', 100],
11+
'body-leading-blank': [2, 'always'],
12+
'footer-leading-blank': [0, 'always'],
13+
// Only enforce the rule if CI flag is not set. This is useful for release
14+
// commits to skip DCO
15+
'signed-off-by': [isCI ? 0 : 2, 'always', 'Signed-off-by:'],
16+
},
17+
};

0 commit comments

Comments
 (0)