Skip to content

Commit 5910001

Browse files
committed
ci: update pipelines
Signed-off-by: Rifa Achrinza <[email protected]>
1 parent 51a165d commit 5910001

9 files changed

+12131
-8
lines changed

.github/codeql/codeql-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
paths-ignore:
2+
- test
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: [master]
10+
schedule:
11+
- cron: '0 2 * * 1' # At 02:00 on Monday
12+
13+
permissions: {}
14+
15+
jobs:
16+
test:
17+
name: Test
18+
timeout-minutes: 15
19+
strategy:
20+
matrix:
21+
os: [ubuntu-latest]
22+
node-version: [10, 12, 14, 16]
23+
include:
24+
- os: macos-latest
25+
node-version: 14 # LTS
26+
- os: windows-latest
27+
node-version: 14 # LTS
28+
fail-fast: false
29+
runs-on: ${{ matrix.os }}
30+
steps:
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v2
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
- name: Update NPM
39+
run: npm install -g npm
40+
- name: Bootstrap project
41+
if: ${{ !contains(fromJSON('[4, 6, 8]'), matrix.node-version) }}
42+
run: npm ci
43+
- name: Run tests
44+
run: npm test --ignore-scripts
45+
- name: Coveralls Parallel
46+
uses: coverallsapp/github-action@master
47+
with:
48+
github-token: ${{ secrets.github_token }}
49+
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
50+
path-to-lcov: ${{ github.workspace }}/coverage/lcov.info
51+
parallel: true
52+
53+
posttest:
54+
name: Post-Test
55+
needs: test
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Coveralls Finish
59+
uses: coverallsapp/github-action@master
60+
with:
61+
github-token: ${{ secrets.github_token }}
62+
parallel-finished: true
63+
64+
code-lint:
65+
name: Commit Lint
66+
runs-on: ubuntu-latest
67+
if: ${{ github.event.pull_request }}
68+
steps:
69+
- uses: actions/checkout@v2
70+
with:
71+
fetch-depth: 0
72+
- name: Use Node.js 14
73+
uses: actions/setup-node@v2
74+
with:
75+
node-version: 14
76+
- name: Bootstrap project
77+
run: npm ci --ignore-scripts
78+
- name: Verify commit linting
79+
run: npm run lint
80+
81+
commit-lint:
82+
name: Commit Lint
83+
runs-on: ubuntu-latest
84+
if: ${{ github.event.pull_request }}
85+
steps:
86+
- uses: actions/checkout@v2
87+
- name: Use Node.js 14
88+
uses: actions/setup-node@v2
89+
with:
90+
node-version: 14
91+
- name: Bootstrap project
92+
run: npm ci --ignore-scripts
93+
- name: Verify commit linting
94+
run: npx commitlint --from origin/master --to HEAD --verbose
95+
96+
codeql:
97+
name: CodeQL
98+
runs-on: ubuntu-latest
99+
permissions:
100+
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
101+
security-events: write
102+
steps:
103+
- uses: actions/checkout@v2
104+
- name: Initialize CodeQL
105+
uses: github/codeql-action/init@v1
106+
with:
107+
languages: 'javascript'
108+
config-file: ./.github/codeql/codeql-config.yaml
109+
- name: Perform CodeQL Analysis
110+
uses: github/codeql-action/analyze@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules
22
.project
33
.idea
4+
.nyc_output
45
coverage
56
lib-cov
67
*.seed

.npmrc

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

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
arch:
2+
- arm64
3+
- ppc64le
4+
- s390x
5+
language: node_js
6+
node_js: [10, 12, 14, 16]
7+
before_install: npm install -g npm
8+
script: npm test --ignore-scripts

commitlint.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright IBM Corp. 2017,2021. All Rights Reserved.
2+
// Node module: loopback-connector-sqlite3
3+
// This file is licensed under the MIT License.
4+
// License text available at https://opensource.org/licenses/MIT
5+
6+
let isCI = process.env.CI;
7+
module.exports = {
8+
extends: [
9+
'@commitlint/config-conventional',
10+
],
11+
rules: {
12+
'header-max-length': [2, 'always', 100],
13+
'body-leading-blank': [2, 'always'],
14+
'footer-leading-blank': [0, 'always'],
15+
// Only enforce the rule if CI flag is not set. This is useful for release
16+
// commits to skip DCO
17+
'signed-off-by': [isCI ? 0 : 2, 'always', 'Signed-off-by:'],
18+
},
19+
};

0 commit comments

Comments
 (0)