Skip to content

Commit

Permalink
ci: update ci pipeline
Browse files Browse the repository at this point in the history
- Prepare Renovate config for v6.x branch
- Tidy pipeline code
- Drop uneeded test matrix (semver-major release)
- Pin GitHub Actions action to Git commit hash

see: loopbackio/security#27
see: #720
Signed-off-by: Rifa Achrinza <[email protected]>
  • Loading branch information
achrinza committed Oct 24, 2022
1 parent 9f9f721 commit 749a2c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- master
- 5.x
pull_request:
branches:
- master
- 5.x
schedule:
- cron: '0 2 * * 1' # At 02:00 on Monday

Expand All @@ -21,31 +19,25 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
node-version: [10, 12, 14, 16, 17, 18]
node-version: [14, 16, 18, 19]
mongodb-version: [4.4]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3.5.1
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/[email protected]
uses: supercharge/mongodb-github-action@538a4d2a1041920c47630172445cb688592d6e51 # tag=1.8.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Update NPM (Node.js v10)
if: matrix.node-version == 10
run: npm install --global npm@7
- name: Update NPM
if: matrix.node-version != 10
run: npm install --global npm@8
- name: Run tests
run: npm test --ignore-scripts
run: npm test
- name: Publish coverage report to Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # tag=v1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
Expand All @@ -58,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # tag=v1.1.3
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
Expand All @@ -67,9 +59,9 @@ jobs:
name: Code Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3.5.1
with:
node-version: 16
- name: Bootstrap project
Expand All @@ -81,17 +73,23 @@ jobs:
name: Commit Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3.5.1
with:
node-version: 16
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Verify commit linting
run: npx --no-install commitlint --from origin/master --to HEAD --verbose
run: |
npx
--no-install
commitlint
--from=origin/master
--to=HEAD
--verbose
codeql:
name: CodeQL
Expand All @@ -101,13 +99,13 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@cc7986c02bac29104a72998e67239bb5ee2ee110 # tag=v2.1.28
with:
languages: 'javascript'
config-file: ./.github/codeql/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@cc7986c02bac29104a72998e67239bb5ee2ee110 # tag=v2.1.28
6 changes: 5 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"extends": [
"github>loopbackio/cicd//shared-configs/renovate/base"
],
"baseBranches": ["master", "5.x"]
"baseBranches": [
"master",
"6.x",
"5.x"
]
}

0 comments on commit 749a2c9

Please sign in to comment.