2021-09-26 11:18:04 +00:00
|
|
|
name: CI
|
2021-02-07 23:24:31 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-09-26 11:18:04 +00:00
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * 1' # At 02:00 on Monday
|
|
|
|
|
|
|
|
permissions: {}
|
2021-02-07 23:24:31 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-09-26 11:18:04 +00:00
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
timeout-minutes: 15
|
2021-02-07 23:24:31 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-26 11:18:04 +00:00
|
|
|
os: [ubuntu-latest]
|
2023-10-13 12:27:14 +00:00
|
|
|
node-version: [18, 20]
|
2021-09-26 11:18:04 +00:00
|
|
|
include:
|
|
|
|
- os: macos-latest
|
2023-10-13 12:27:14 +00:00
|
|
|
node_version: 18
|
2021-09-26 11:18:04 +00:00
|
|
|
- os: windows-latest
|
2023-10-13 12:27:14 +00:00
|
|
|
node_version: 18
|
2021-09-26 11:18:04 +00:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2023-10-17 17:11:28 +00:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2024-02-07 07:04:22 +00:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Bootstrap project
|
|
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Run tests
|
2021-12-08 04:53:42 +00:00
|
|
|
run: npm run-script test:ci
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Publish coverage report to Coveralls
|
2023-09-07 14:29:30 +00:00
|
|
|
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2.2.3
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
|
|
|
|
parallel: true
|
|
|
|
|
|
|
|
posttest:
|
|
|
|
name: Post-Test
|
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Coveralls finished
|
2023-09-07 14:29:30 +00:00
|
|
|
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2.2.3
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel-finished: true
|
|
|
|
|
|
|
|
code-lint:
|
|
|
|
name: Code Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-17 17:11:28 +00:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-10-13 12:27:14 +00:00
|
|
|
- name: Use Node.js 18
|
2024-02-07 07:04:22 +00:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
2023-10-13 12:27:14 +00:00
|
|
|
node-version: 18
|
2021-09-26 11:18:04 +00:00
|
|
|
- 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:
|
2023-10-17 17:11:28 +00:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-10-13 12:27:14 +00:00
|
|
|
- name: Use Node.js 18
|
2024-02-07 07:04:22 +00:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
2023-10-13 12:27:14 +00:00
|
|
|
node-version: 18
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Bootstrap project
|
|
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Verify commit linting
|
2021-12-08 04:53:42 +00:00
|
|
|
run: |
|
|
|
|
npx \
|
|
|
|
--no-install \
|
|
|
|
--package=@commitlint/cli \
|
|
|
|
-- \
|
|
|
|
commitlint \
|
|
|
|
--from=origin/master \
|
|
|
|
--to=HEAD \
|
|
|
|
--verbose
|
2021-09-26 11:18:04 +00:00
|
|
|
|
|
|
|
codeql:
|
|
|
|
name: CodeQL
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
|
|
|
|
security-events: write
|
2021-02-07 23:24:31 +00:00
|
|
|
steps:
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Checkout repository
|
2023-10-17 17:11:28 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Initialize CodeQL
|
2024-02-29 16:32:59 +00:00
|
|
|
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
|
2021-02-07 23:24:31 +00:00
|
|
|
with:
|
2021-09-26 11:18:04 +00:00
|
|
|
languages: 'javascript'
|
|
|
|
config-file: ./.github/codeql/codeql-config.yaml
|
2021-02-07 23:24:31 +00:00
|
|
|
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Perform CodeQL Analysis
|
2024-02-29 16:32:59 +00:00
|
|
|
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
|