Skip to content

Commit 69a87fb

Browse files
committed
chore: add CI - commit and code linting
Signed-off-by: dhmlau <dhmlau@ca.ibm.com>
1 parent 6965347 commit 69a87fb

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
permissions: {}
10+
11+
env:
12+
NODE_OPTIONS: --max-old-space-size=4096
13+
14+
jobs:
15+
test:
16+
name: Test
17+
timeout-minutes: 30
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest]
21+
node-version: [20, 22, 24]
22+
include:
23+
- os: windows-latest
24+
node-version: 22 # LTS
25+
- os: macos-latest
26+
node-version: 22 # LTS
27+
fail-fast: false
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
- run: npm install
36+
- name: Run test
37+
run: npm test --ignore-scripts
38+
39+
code-lint:
40+
name: Code Lint
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 22 # LTS
47+
- run: npm install --ignore-scripts
48+
- name: Verify code linting
49+
run: npx --no eslint .
50+
51+
commit-lint:
52+
name: Commit Lint
53+
runs-on: ubuntu-latest
54+
if: ${{ github.event.pull_request }}
55+
steps:
56+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
57+
with:
58+
fetch-depth: 0
59+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
60+
with:
61+
node-version: 22 # LTS
62+
- name: Install dependencies
63+
run: npm install
64+
- name: Verify commit linting
65+
run: npx commitlint --from origin/master --to HEAD --verbose

commitlint.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright IBM Corp. and LoopBack contributors 2025. All Rights Reserved.
2+
// Node module: loopback-connector-postgresql
3+
// This file is licensed under the MIT License.
4+
// License text available at https://opensource.org/licenses/MIT
5+
6+
'use strict';
7+
8+
module.exports = {
9+
extends: [
10+
'@commitlint/config-conventional',
11+
],
12+
rules: {
13+
'header-max-length': [2, 'always', 100],
14+
'body-leading-blank': [2, 'always'],
15+
'footer-leading-blank': [0, 'always'],
16+
'signed-off-by': [2, 'always', 'Signed-off-by:'],
17+
},
18+
};

0 commit comments

Comments
 (0)