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]
|
2021-12-08 04:53:42 +00:00
|
|
|
node-version: [10, 12, 14, 16, 17]
|
2021-09-26 11:18:04 +00:00
|
|
|
include:
|
|
|
|
- os: macos-latest
|
2021-12-08 04:53:42 +00:00
|
|
|
node_version: 16
|
2021-09-26 11:18:04 +00:00
|
|
|
- os: windows-latest
|
2021-12-08 04:53:42 +00:00
|
|
|
node_version: 16
|
2021-09-26 11:18:04 +00:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2023-01-05 15:53:41 +00:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-01-05 19:11:03 +00:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
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-02-24 15:49:49 +00:00
|
|
|
uses: coverallsapp/github-action@0363cd28f449b7e5d3b6c6d269d31fe7c1201b68 # v1.2.0
|
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-02-24 15:49:49 +00:00
|
|
|
uses: coverallsapp/github-action@0363cd28f449b7e5d3b6c6d269d31fe7c1201b68 # v1.2.0
|
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-01-05 15:53:41 +00:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2021-12-08 04:53:42 +00:00
|
|
|
- name: Use Node.js 16
|
2023-01-05 19:11:03 +00:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
2021-12-08 04:53:42 +00:00
|
|
|
node-version: 16
|
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-01-05 15:53:41 +00:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-12-08 04:53:42 +00:00
|
|
|
- name: Use Node.js 16
|
2023-01-05 19:11:03 +00:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2021-09-26 11:18:04 +00:00
|
|
|
with:
|
2021-12-08 04:53:42 +00:00
|
|
|
node-version: 16
|
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-01-05 15:53:41 +00:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Initialize CodeQL
|
2023-02-10 22:25:46 +00:00
|
|
|
uses: github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
|
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
|
2023-02-10 22:25:46 +00:00
|
|
|
uses: github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
|