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-12-12 20:00:24 +00:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-10-13 12:38:56 +00:00
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3.5.1
|
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-12-12 20:00:24 +00:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2021-12-08 04:53:42 +00:00
|
|
|
- name: Use Node.js 16
|
2022-10-13 12:38:56 +00:00
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3.5.1
|
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-12-12 20:00:24 +00:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.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-10-13 12:38:56 +00:00
|
|
|
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3.5.1
|
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-12-12 20:00:24 +00:00
|
|
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2021-09-26 11:18:04 +00:00
|
|
|
- name: Initialize CodeQL
|
2022-12-14 16:19:37 +00:00
|
|
|
uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
|
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-12-14 16:19:37 +00:00
|
|
|
uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
|