Skip to content

Commit af3d054

Browse files
committed
ci: update ci
Signed-off-by: Rifa Achrinza <[email protected]>
1 parent 2fb7979 commit af3d054

File tree

7 files changed

+9563
-17
lines changed

7 files changed

+9563
-17
lines changed

.github/codeql/codeql-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
paths-ignore: [test]
Lines changed: 95 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continuous Integration
1+
name: CI
22

33
on:
44
push:
@@ -7,21 +7,106 @@ on:
77
pull_request:
88
branches:
99
- master
10+
schedule:
11+
- cron: '0 2 * * 1' # At 02:00 on Monday
12+
13+
permissions: {}
1014

1115
jobs:
12-
build:
13-
runs-on: ubuntu-latest
16+
test:
17+
name: Test
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 15
1420
strategy:
1521
matrix:
16-
node-version: [10, 12, 14]
22+
os: [ubuntu-latest]
23+
node-version: [10, 12, 14, 16]
24+
include:
25+
- os: macos-latest
26+
node_version: 14
27+
- os: windows-latest
28+
node_version: 14
29+
fail-fast: false
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
- name: Update NPM
37+
if: matrix.os != 'macos-latest'
38+
run: npm install --global npm
39+
- name: Update NPM (macOS)
40+
if: matrix.os == 'macos-latest'
41+
run: npm install --global --force npm
42+
- name: Bootstrap project
43+
run: npm ci --ignore-scripts
44+
- name: Run tests
45+
run: npm test --ignore-scripts
46+
- name: Publish coverage report to Coveralls
47+
uses: coverallsapp/github-action@master
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
51+
path-to-lcov: ${{ github.workspace }}/coverage/lcov.info
52+
parallel: true
53+
54+
posttest:
55+
name: Post-Test
56+
needs: test
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Coveralls finished
60+
uses: coverallsapp/github-action@master
61+
with:
62+
github-token: ${{ secrets.github_token }}
63+
parallel-finished: true
64+
65+
code-lint:
66+
name: Code Lint
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v2
70+
- name: Use Node.js 14
71+
uses: actions/setup-node@v2
72+
with:
73+
node-version: 14
74+
- name: Bootstrap project
75+
run: npm ci --ignore-scripts
76+
- name: Verify code linting
77+
run: npm run lint
78+
79+
commit-lint:
80+
name: Commit Lint
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v2
84+
with:
85+
fetch-depth: 0
86+
- name: Use Node.js 14
87+
uses: actions/setup-node@v2
88+
with:
89+
node-version: 14
90+
- name: Bootstrap project
91+
run: npm ci --ignore-scripts
92+
- name: Verify commit linting
93+
run: npx --no-install commitlint --from origin/master --to HEAD --verbose
94+
95+
codeql:
96+
name: CodeQL
97+
runs-on: ubuntu-latest
98+
permissions:
99+
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
100+
security-events: write
17101
steps:
18-
- name: Git checkout
102+
- name: Checkout repository
19103
uses: actions/checkout@v2
20104

21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v1
105+
- name: Initialize CodeQL
106+
uses: github/codeql-action/init@v1
23107
with:
24-
node-version: ${{ matrix.node-version }}
108+
languages: 'javascript'
109+
config-file: ./.github/codeql/codeql-config.yaml
25110

26-
- run: npm install
27-
- run: npm test
111+
- name: Perform CodeQL Analysis
112+
uses: github/codeql-action/analyze@v1

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
package-lock=false
1+
package-lock=true
2+
scripts-prepend-node-path=true

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
sudo: false
1+
branches:
2+
only: master
3+
arch:
4+
- arm64
5+
- ppc64le
6+
- s390x
27
language: node_js
38
node_js:
4-
- "10"
5-
- "12"
6-
- "14"
9+
- 10
10+
- 12
11+
- 14
12+
- 16
13+
install:
14+
- npm install --global npm
15+
- npm ci --ignore-scripts
16+
script: npm test --ignore-scripts

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: loopback-connector
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)