Skip to content

Commit 9f1c3f6

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

File tree

7 files changed

+13312
-3
lines changed

7 files changed

+13312
-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: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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: [50000]
32+
volumes:
33+
- /mnt/clusterfs:/mnt/bludata0
34+
- /mnt/clusterfs:/mnt/blumeta0
35+
options: --privileged
36+
env:
37+
DASHDB_USERNAME: bluadmin
38+
DASHDB_PASSWORD: PASSWORD123
39+
steps:
40+
- name: Setup database
41+
run: docker exec ${{ job.services.dashdb.id }} setpass PASSWORD123
42+
- uses: actions/checkout@v2
43+
- name: Use Node.js ${{ matrix.node-version }}
44+
uses: actions/setup-node@v1
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
- name: Bootstrap project
48+
run: npm ci
49+
- name: Update NPM
50+
run: npm install --global npm
51+
- name: Run tests
52+
run: |
53+
npm run pretest --ignore-scripts
54+
npm test --ignore-scripts
55+
- name: Publish coverage report to Coveralls
56+
uses: coverallsapp/github-action@master
57+
with:
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
60+
path-to-lcov: ${{ github.workspace }}/coverage/lcov.info
61+
parallel: true
62+
63+
posttest:
64+
name: Post-Test
65+
needs: test
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Coveralls finished
69+
uses: coverallsapp/github-action@master
70+
with:
71+
github-token: ${{ secrets.github_token }}
72+
parallel-finished: true
73+
74+
code-lint:
75+
name: Code Lint
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v2
79+
- name: Use Node.js 14
80+
uses: actions/setup-node@v2
81+
with:
82+
node-version: 14
83+
- name: Bootstrap project
84+
run: npm ci --ignore-scripts
85+
- name: Verify code linting
86+
run: npm run lint
87+
88+
commit-lint:
89+
name: Commit Lint
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v2
93+
with:
94+
fetch-depth: 0
95+
- name: Use Node.js 14
96+
uses: actions/setup-node@v2
97+
with:
98+
node-version: 14
99+
- name: Bootstrap project
100+
run: npm ci --ignore-scripts
101+
- name: Verify commit linting
102+
run: npx --no-install commitlint --from origin/master --to HEAD --verbose
103+
104+
codeql:
105+
name: CodeQL
106+
runs-on: ubuntu-latest
107+
permissions:
108+
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
109+
security-events: write
110+
steps:
111+
- name: Checkout repository
112+
uses: actions/checkout@v2
113+
114+
- name: Initialize CodeQL
115+
uses: github/codeql-action/init@v1
116+
with:
117+
languages: 'javascript'
118+
config-file: ./.github/codeql/codeql-config.yaml
119+
120+
- name: Perform CodeQL Analysis
121+
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)