Skip to content

Commit 8488b90

Browse files
committed
ci: update pipelines
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
1 parent ae80066 commit 8488b90

File tree

7 files changed

+13315
-3
lines changed

7 files changed

+13315
-3
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]

.github/workflows/ci.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- 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+
runs-on: ubuntu-latest
19+
timeout-minutes: 15
20+
strategy:
21+
matrix:
22+
node-version: [10, 12, 14, 16]
23+
mongodb-version: [4.4]
24+
fail-fast: false
25+
services:
26+
dashdb:
27+
image: icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-linux
28+
credentials:
29+
username: iamapikey
30+
password: ${{ secrets.IBM_CLOUD_API_KEY }}
31+
ports:
32+
- 50000
33+
- 50001
34+
- 389
35+
volumes:
36+
- /mnt/clusterfs:/mnt/bludata0
37+
- /mnt/clusterfs:/mnt/blumeta0
38+
options: --privileged
39+
env:
40+
DASHDB_USERNAME: bluadmin
41+
DASHDB_PASSWORD: PASSWORD123
42+
steps:
43+
- name: Setup database
44+
run: docker exec ${{ job.services.dashdb.id }} setpass PASSWORD123
45+
- uses: actions/checkout@v2
46+
- name: Use Node.js ${{ matrix.node-version }}
47+
uses: actions/setup-node@v1
48+
with:
49+
node-version: ${{ matrix.node-version }}
50+
- name: Bootstrap project
51+
run: npm ci
52+
- name: Update NPM
53+
run: npm install --global npm
54+
- name: Run tests
55+
run: |
56+
npm run pretest --ignore-scripts
57+
npm test --ignore-scripts
58+
- name: Publish coverage report to Coveralls
59+
uses: coverallsapp/github-action@master
60+
with:
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
63+
path-to-lcov: ${{ github.workspace }}/coverage/lcov.info
64+
parallel: true
65+
66+
posttest:
67+
name: Post-Test
68+
needs: test
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Coveralls finished
72+
uses: coverallsapp/github-action@master
73+
with:
74+
github-token: ${{ secrets.github_token }}
75+
parallel-finished: true
76+
77+
code-lint:
78+
name: Code Lint
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Use Node.js 14
83+
uses: actions/setup-node@v2
84+
with:
85+
node-version: 14
86+
- name: Bootstrap project
87+
run: npm ci --ignore-scripts
88+
- name: Verify code linting
89+
run: npm run lint
90+
91+
commit-lint:
92+
name: Commit Lint
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v2
96+
with:
97+
fetch-depth: 0
98+
- name: Use Node.js 14
99+
uses: actions/setup-node@v2
100+
with:
101+
node-version: 14
102+
- name: Bootstrap project
103+
run: npm ci --ignore-scripts
104+
- name: Verify commit linting
105+
run: npx --no-install commitlint --from origin/master --to HEAD --verbose
106+
107+
codeql:
108+
name: CodeQL
109+
runs-on: ubuntu-latest
110+
permissions:
111+
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
112+
security-events: write
113+
steps:
114+
- name: Checkout repository
115+
uses: actions/checkout@v2
116+
117+
- name: Initialize CodeQL
118+
uses: github/codeql-action/init@v1
119+
with:
120+
languages: 'javascript'
121+
config-file: ./.github/codeql/codeql-config.yaml
122+
123+
- name: Perform CodeQL Analysis
124+
uses: github/codeql-action/analyze@v1

.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

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. 2016,2021. All Rights Reserved.
2+
// Node module: loopback-connector-dashdb
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)