-
-
Notifications
You must be signed in to change notification settings - Fork 22
87 lines (82 loc) · 2.18 KB
/
code-checks.yaml
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
name: Code Checks
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
setup:
name: Setup Environment
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache-check.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
with:
lfs: false
- name: Checkout LFS
run: git lfs pull
- uses: actions/setup-node@v4
with:
node-version-file: "project/.nvmrc"
cache: "npm"
cache-dependency-path: "project/package.json"
- name: Check Cache
id: cache-check
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('project/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM Dependencies
if: steps.cache-check.outputs.cache-hit != 'true'
run: npm install
working-directory: ./project
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: project-files
path: ./project
retention-days: 1
compression-level: 4
overwrite: true
lint:
name: Linter
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.cache-hit == 'true' || always()
steps:
- uses: actions/download-artifact@v4
with:
name: project-files
path: ./project
- name: Run Linter
run: npm run lint
working-directory: ./project
test:
name: Tests
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.cache-hit == 'true' || always()
steps:
- uses: actions/download-artifact@v4
with:
name: project-files
path: ./project
- name: Run Tests
run: npm run test
working-directory: ./project
types:
name: TypeScript Type Check
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.cache-hit == 'true' || always()
steps:
- uses: actions/download-artifact@v4
with:
name: project-files
path: ./project
- name: Run Type Check
run: npm run lint:types
working-directory: ./project