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:
|
2022-10-04 11:53:19 +00:00
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-09-27 15:40:07 +00:00
|
|
|
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3.5.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
|
2022-08-28 13:46:41 +00:00
|
|
|
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # tag=v1.1.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
|
2022-08-28 13:46:41 +00:00
|
|
|
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # tag=v1.1.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:
|
2022-10-04 11:53:19 +00:00
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
2021-12-08 04:53:42 +00:00
|
|
|
- name: Use Node.js 16
|
2022-09-27 15:40:07 +00:00
|
|
|
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3.5.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:
|
2022-10-04 11:53:19 +00:00
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.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
|
2022-09-27 15:40:07 +00:00
|
|
|
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3.5.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
|
2022-10-04 11:53:19 +00:00
|
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Initialize CodeQL
|
2022-10-06 23:32:01 +00:00
|
|
|
uses: github/codeql-action/init@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2.1.27
|
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
|
2022-10-06 23:32:01 +00:00
|
|
|
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2.1.27
|