-
Notifications
You must be signed in to change notification settings - Fork 36
94 lines (88 loc) · 2.69 KB
/
continuous-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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
permissions: {}
jobs:
test:
name: Test
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16, 18, 20]
include:
- os: macos-latest
node-version: 20 # LTS
- os: window-latest
node-version: 20 # LTS
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
if: ${{ strategy.os == 'ubuntu-latest' }}
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Bootstrap project
run: |
npm ci --ignore-scripts
- uses: Yuri6037/Action-FakeTTY@1abc69c7d530815855caedcd73842bae5687c1a6 # v1.1
- name: Run tests
run: faketty npm test --ignore-scripts
code-lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
if: ${{ strategy.os == 'ubuntu-latest' }}
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- 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: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
if: ${{ strategy.os == 'ubuntu-latest' }}
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Bootstrap project
run: |
npm ci --ignore-scripts
- name: Verify commit linting
run: |
npm run \
--no-install \
commitlint \
--from origin/master \
--to HEAD \
--verbose