75 lines
1.8 KiB
YAML
75 lines
1.8 KiB
YAML
name: Continuous Integration
|
|
|
|
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
|
|
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
timeout-minutes: 15
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
node-version: [16, 18]
|
|
include:
|
|
- os: macos-latest
|
|
node-version: 16 # LTS
|
|
fail-fast: false
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Bootstrap project
|
|
run: |
|
|
npm ci --ignore-scripts
|
|
- uses: Yuri6037/Action-FakeTTY@v1.1
|
|
- name: Run tests
|
|
run: faketty npm test --ignore-scripts
|
|
|
|
code-lint:
|
|
name: Code Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js 16
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
- 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
|
|
if: ${{ github.event.pull_request }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Use Node.js 16
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
- name: Bootstrap project
|
|
run: |
|
|
npm ci --ignore-scripts
|
|
- name: Verify commit linting
|
|
run: npx commitlint --from origin/master --to HEAD --verbose
|