Skip to content

Commit baf0759

Browse files
authored
Merge pull request #634 from loopbackio/ci/run-on-5.x-branch
ci: add workflow for 5.x
2 parents 2e36cb0 + 105756a commit baf0759

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

.github/codeql/codeql-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
paths-ignore: [test]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Continuous Integration (5.x branch)
2+
3+
on:
4+
push:
5+
branches:
6+
- 5.x
7+
pull_request:
8+
branches:
9+
- 5.x
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node-version: [10, 12, 14]
17+
mongodb-version: [4.4] # the latest stable version
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Start MongoDB
27+
uses: supercharge/[email protected]
28+
with:
29+
mongodb-version: ${{ matrix.mongodb-version }}
30+
31+
- run: npm install
32+
- run: npm test
33+
34+
code-lint:
35+
name: Code Lint
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Use Node.js 14
40+
uses: actions/setup-node@v2
41+
with:
42+
node-version: 14
43+
- name: Bootstrap project
44+
run: npm install --ignore-scripts
45+
- name: Verify code linting
46+
run: npm run lint
47+
48+
commit-lint:
49+
name: Commit Lint
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
with:
54+
fetch-depth: 0
55+
- name: Use Node.js 14
56+
uses: actions/setup-node@v2
57+
with:
58+
node-version: 14
59+
- name: Bootstrap project
60+
run: npm install
61+
- name: Verify commit linting
62+
run: npx commitlint --from origin/5.x --to HEAD --verbose
63+
64+
codeql:
65+
name: CodeQL
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v2
70+
71+
- name: Initialize CodeQL
72+
uses: github/codeql-action/init@v1
73+
with:
74+
languages: 'javascript'
75+
config-file: ./.github/codeql/codeql-config.yml
76+
77+
- name: Perform CodeQL Analysis
78+
uses: github/codeql-action/analyze@v1

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. 2012,2021. All Rights Reserved.
2+
// Node module: loopback4-example-shopping-monorepo
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+
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@
4646
"strong-globalize": "^6.0.0"
4747
},
4848
"devDependencies": {
49+
"@commitlint/config-conventional": "^13.1.0",
4950
"benchmark": "^2.1.4",
5051
"bluebird": "^3.5.4",
52+
"commitlint": "^13.1.0",
5153
"coveralls": "^3.0.4",
5254
"eslint": "^6.6.0",
5355
"eslint-config-loopback": "^13.0.0",

0 commit comments

Comments
 (0)