-
Notifications
You must be signed in to change notification settings - Fork 8
62 lines (49 loc) · 1.66 KB
/
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
name: '[event] On pull request'
on:
push:
branches:
- main
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0 # needed for nx affected
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.15.5
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.17.1
- name: Set env
shell: sh
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
echo "PNPM_LOCK_HASH=${{ hashFiles('pnpm-lock.yaml') }}" >> $GITHUB_ENV
echo "PNPM_VERSION=$(pnpm -v)" >> $GITHUB_ENV
- name: Cache node_modules
uses: actions/cache@v3
with:
path: ${{ env.PNPM_STORE_PATH }}
# primary cache is based on pnpm-lock.yaml
key: pnpm-${{ env.PNPM_VERSION }}-${{ env.PNPM_LOCK_HASH }}
# if primary cache is not found, then use any other cache available
# it doesn't matter if it's incomplete, at least some packages will be cached
restore-keys: pnpm-${{ env.PNPM_VERSION }}
- name: Install dependencies
shell: sh
run: pnpm i --frozen-lockfile
- run: pnpm commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD --verbose
- name: Configure NX
uses: nrwl/[email protected]
- name: Build
run: pnpm nx affected --target=lint --parallel
- name: Lint
run: pnpm nx affected --target=lint --parallel
- name: Test
run: pnpm nx affected --target=test --parallel