-
Notifications
You must be signed in to change notification settings - Fork 11k
85 lines (71 loc) · 2.24 KB
/
ci-code-check.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
name: Code Checks
on:
workflow_call:
inputs:
node-version:
required: true
type: string
deno-version:
required: true
type: string
env:
TOOL_NODE_FLAGS: ${{ vars.TOOL_NODE_FLAGS }}
jobs:
code-check:
runs-on: ubuntu-20.04
name: ${{ matrix.check == 'ts' && 'TypeScript' || 'Code Lint' }}
strategy:
fail-fast: false
matrix:
check: ['ts', 'lint']
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 4
- uses: actions/checkout@v4
- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
deno-version: ${{ inputs.deno-version }}
cache-modules: true
install: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Free disk space
# run: |
# sudo apt clean
# docker rmi $(docker image ls -aq)
# df -h
- uses: rharkor/[email protected]
- name: Restore turbo build
uses: actions/download-artifact@v4
with:
name: turbo-build
path: .turbo/cache
- name: Cache TypeCheck
uses: actions/cache@v4
if: matrix.check == 'ts'
with:
path: ./apps/meteor/tsconfig.typecheck.tsbuildinfo
key: typecheck-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}-${{ github.event.issue.number }}
restore-keys: |
typecheck-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}
typecheck-cache-${{ runner.OS }}
typecheck-cache
- name: TS TypeCheck
if: matrix.check == 'ts'
run: yarn turbo run typecheck
- name: Cache eslint
uses: actions/cache@v4
if: matrix.check == 'lint'
with:
path: ./apps/meteor/.eslintcache
key: eslintcache-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}-${{ github.event.issue.number }}
restore-keys: |
eslintcache-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}
eslintcache-cache-${{ runner.OS }}
eslintcache-cache
- name: Lint
if: matrix.check == 'lint'
run: yarn lint