-
Notifications
You must be signed in to change notification settings - Fork 88
69 lines (57 loc) · 1.88 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
env:
NX_VERBOSE_LOGGING: true
#NX_NO_CLOUD: true
# Needed for nx-set-shas when run on the main branch
permissions:
actions: read
contents: read
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false
- name: Start CI run
run: npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js" --stop-agents-after=build
- name: Restore cached npm dependencies
id: cache-dependencies-restore
uses: actions/cache/restore@v3
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm install --frozen-lockfile
- name: Cache npm dependencies
id: cache-dependencies-save
uses: actions/cache/save@v3
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}
- uses: nrwl/nx-set-shas@v3
# This line is needed for nx affected to work when CI is running on a PR
# - run: git branch --track main origin/main
- run: pnpm nx-cloud record -- nx format:check
- run: pnpm nx affected --target=lint --parallel=3
# TODO: (chau) local-plugin test is faulty right now with Jest and ESM. Will fix later
- run: pnpm nx affected --target=test --parallel=3 --exclude=local-plugin
- run: pnpm nx affected --target=build --parallel=3 --exclude=docs