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-03-24 07:11:08 +00:00
|
|
|
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.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-04-10 09:53:51 +00:00
|
|
|
uses: coverallsapp/github-action@045a25193560dc194e405657f552faeb6b9433aa # v2.1.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-04-10 09:53:51 +00:00
|
|
|
uses: coverallsapp/github-action@045a25193560dc194e405657f552faeb6b9433aa # v2.1.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-03-24 07:11:08 +00:00
|
|
|
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.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-03-24 07:11:08 +00:00
|
|
|
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.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-03-24 07:11:08 +00:00
|
|
|
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Initialize CodeQL
|
2023-04-06 18:59:02 +00:00
|
|
|
uses: github/codeql-action/init@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2.2.11
|
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-04-06 18:59:02 +00:00
|
|
|
uses: github/codeql-action/analyze@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2.2.11
|