117 lines
3.0 KiB
YAML
117 lines
3.0 KiB
YAML
|
name: CI
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches: [master]
|
||
|
pull_request:
|
||
|
# The branches below must be a subset of the branches above
|
||
|
branches: [master]
|
||
|
schedule:
|
||
|
- cron: '0 2 * * 1' # At 02:00 on Monday
|
||
|
|
||
|
jobs:
|
||
|
test:
|
||
|
name: Test
|
||
|
timeout-minutes: 15
|
||
|
strategy:
|
||
|
matrix:
|
||
|
os: [ubuntu-latest]
|
||
|
node-version: [10, 12, 14, 16]
|
||
|
include:
|
||
|
- os: macos-latest
|
||
|
node-version: 14
|
||
|
- os: windows-latest
|
||
|
node-version: 14
|
||
|
fail-fast: false
|
||
|
runs-on: ${{ matrix.os }}
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
with:
|
||
|
fetch-depth: 0
|
||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ matrix.node-version }}
|
||
|
- name: Update NPM
|
||
|
run: npm install --global npm
|
||
|
- name: Bootstrap project
|
||
|
run: npm ci --ignore-scripts
|
||
|
- name: Build project
|
||
|
run: npm run build
|
||
|
- name: Run tests
|
||
|
run: npm test --ignore-scripts
|
||
|
- name: Generate coverage report
|
||
|
run: npx --no-install nyc report --reporter=lcov
|
||
|
- name: Publish coverage report to Coveralls
|
||
|
uses: coverallsapp/github-action@master
|
||
|
with:
|
||
|
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
|
||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||
|
parallel: true
|
||
|
|
||
|
posttest:
|
||
|
name: Post-Test
|
||
|
needs: test
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Coveralls finished
|
||
|
uses: coverallsapp/github-action@master
|
||
|
with:
|
||
|
github-token: ${{ secrets.github_token }}
|
||
|
parallel-finished: true
|
||
|
|
||
|
code-lint:
|
||
|
name: Code Lint
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
with:
|
||
|
fetch-depth: 0
|
||
|
- name: Use Node.js 14
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: 14
|
||
|
- name: Update NPM
|
||
|
run: npm install --global npm
|
||
|
- name: Bootstrap project
|
||
|
run: npm ci --ignore-scripts
|
||
|
- name: Build project
|
||
|
run: npm run build
|
||
|
- name: Verify code linting
|
||
|
run: npm run lint
|
||
|
|
||
|
commit-lint:
|
||
|
name: Commit Lint
|
||
|
runs-on: ubuntu-latest
|
||
|
if: ${{ github.event.pull_request }}
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
with:
|
||
|
fetch-depth: 0
|
||
|
- name: Use Node.js 14
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: 14
|
||
|
- name: Update NPM
|
||
|
run: npm install --global npm
|
||
|
- name: Bootstrap project
|
||
|
run: npm ci --ignore-scripts
|
||
|
- name: Verify commit linting
|
||
|
run: npx --no-install commitlint --from origin/master --to HEAD --verbose
|
||
|
|
||
|
codeql:
|
||
|
name: CodeQL
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v2
|
||
|
|
||
|
- name: Initialize CodeQL
|
||
|
uses: github/codeql-action/init@v1
|
||
|
with:
|
||
|
languages: 'javascript'
|
||
|
config-file: ./.github/codeql/codeql-config.yaml
|
||
|
|
||
|
- name: Perform CodeQL Analysis
|
||
|
uses: github/codeql-action/analyze@v1
|