-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.3 KB
/
Copy pathci.yml
File metadata and controls
59 lines (47 loc) · 1.3 KB
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
name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
# Least-privilege permissions — satisfies CodeQL actions/missing-workflow-permissions (alert #5).
# The job only needs to read the repository contents and upload artifacts;
# no write access is required.
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test:
name: Lint · Typecheck · Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup Node.js
uses: actions/setup-node@v4.3.0
with:
node-version: 20
- name: Cache npm dependencies
uses: actions/cache@v4.2.3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Lint
run: npx eslint src --max-warnings 0
- name: Typecheck
run: npx tsc --noEmit
- name: Run tests
run: npm test
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4.6.2
with:
name: coverage
path: coverage/
retention-days: 14
if-no-files-found: ignore