Skip to content

Commit

Permalink
ci: update pipelines
Browse files Browse the repository at this point in the history
Signed-off-by: Rifa Achrinza <[email protected]>
  • Loading branch information
achrinza committed Sep 28, 2021
1 parent ae80066 commit b40a83f
Show file tree
Hide file tree
Showing 7 changed files with 13,312 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/codeql/codeql-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
paths-ignore: [test]
121 changes: 121 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 2 * * 1' # At 02:00 on Monday

permissions: {}

jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [10, 12, 14, 16]
mongodb-version: [4.4]
fail-fast: false
services:
dashdb:
image: icr.io/obs/hdm/db2wh_ee:v11.5.6.0-db2wh-linux
credentials:
username: iamapikey
password: ${{ secrets.IBM_CLOUD_API_KEY }}
ports: [50000]
volumes:
- /mnt/clusterfs:/mnt/bludata0
- /mnt/clusterfs:/mnt/blumeta0
options: --net=host --privileged
env:
DASHDB_USERNAME: bluadmin
DASHDB_PASSWORD: PASSWORD123
steps:
- name: Setup database
run: docker exec ${{ job.services.dashdb.id }} setpass PASSWORD123
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Bootstrap project
run: npm ci
- name: Update NPM
run: npm install --global npm
- name: Run tests
run: |
npm run pretest --ignore-scripts
npm test --ignore-scripts
- name: Publish coverage report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
path-to-lcov: ${{ github.workspace }}/coverage/lcov.info
parallel: true

posttest:
name: Post-Test
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

code-lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Verify code linting
run: npm run lint

commit-lint:
name: Commit Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Verify commit linting
run: npx --no-install commitlint --from origin/master --to HEAD --verbose

codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: 'javascript'
config-file: ./.github/codeql/codeql-config.yaml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock=true
scripts-prepend-node-path=true
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright IBM Corp. 2016,2021. All Rights Reserved.
// Node module: loopback-connector-dashdb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

'use strict';

module.exports = {
extends: [
'@commitlint/config-conventional',
],
rules: {
'header-max-length': [2, 'always', 100],
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [0, 'always'],
'signed-off-by': [2, 'always', 'Signed-off-by:'],
},
};
Loading

0 comments on commit b40a83f

Please sign in to comment.