-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
config.yml
174 lines (162 loc) · 4.88 KB
/
config.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
version: 2.1
# -------------------------
# ORBS
# -------------------------
orbs:
nx: nrwl/nx@1.6.2
rust: circleci/rust@1.6.0
browser-tools: circleci/browser-tools@1.4.6
# -------------------------
# EXECUTORS
# -------------------------
defaults: &defaults
working_directory: ~/repo
executors:
linux:
<<: *defaults
docker:
- image: cimg/rust:1.73.0-browsers
resource_class: medium+
macos:
<<: *defaults
resource_class: macos.m1.medium.gen1
macos:
xcode: '14.2.0'
# -------------------------
# COMMANDS
# -------------------------
commands:
run-pnpm-install:
parameters:
os:
type: string
steps:
- restore_cache:
name: Restore pnpm Package Cache
keys:
- node-deps-{{ arch }}-v3-{{ checksum "pnpm-lock.yaml" }}
- when:
condition:
equal: [<< parameters.os >>, linux]
steps:
- run:
name: Install pnpm package manager (linux)
command: |
npm install --prefix=$HOME/.local -g @pnpm/exe@8.14
- when:
condition:
equal: [<< parameters.os >>, macos]
steps:
- run:
name: Install pnpm package manager (macos)
command: |
npm install -g @pnpm/exe@8.14
- run:
name: Install Dependencies
command: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps firefox webkit chrome
- save_cache:
name: Save pnpm Package Cache
key: node-deps-{{ arch }}-v3-{{ checksum "pnpm-lock.yaml" }}
paths:
- ~/.pnpm-store
- ~/.cache/Cypress
- node_modules
# -------------------------
# JOBS
# -------------------------
jobs:
# -------------------------
# JOBS: Main Linux
# -------------------------
main-linux:
executor: linux
environment:
NX_E2E_CI_CACHE_KEY: e2e-circleci-linux
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CI_EXECUTION_ENV: 'linux'
steps:
- checkout
- nx/set-shas:
main-branch-name: 'master'
- run: npx nx-cloud@next start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- run:
command: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run-pnpm-install:
os: linux
- run:
name: Check Documentation
command: pnpm nx documentation --no-dte
no_output_timeout: 20m
- run:
name: Run Checks/Lint/Test/Build
no_output_timeout: 60m
command: |
pids=()
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
pids+=($!)
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dte &
pids+=($!)
(pnpm nx affected --targets=lint,test,build --base=$NX_BASE --head=$NX_HEAD --parallel=3 &&
pnpm nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --parallel=1) &
pids+=($!)
for pid in "${pids[@]}"; do
wait "$pid"
done
# -------------------------
# JOBS: Main-MacOS
# -------------------------
mainmacos:
executor: macos
environment:
NX_E2E_CI_CACHE_KEY: e2e-circleci-macos
NX_PERF_LOGGING: 'false'
NX_CI_EXECUTION_ENV: 'macos'
SELECTED_PM: 'npm' # explicitly define npm for macOS tests
steps:
- checkout
- restore_cache:
name: Restore Homebrew packages
keys:
- nrwl-nx-homebrew-packages
- run:
name: Configure Detox Environment, Install applesimutils
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
no_output_timeout: 20m
- save_cache:
name: Save Homebrew Cache
key: nrwl-nx-homebrew-packages
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
- run-pnpm-install:
os: macos
- rust/install
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Run E2E Tests for macOS
command: |
pnpm nx affected -t e2e-macos --parallel=1 --base=$NX_BASE --head=$NX_HEAD
no_output_timeout: 45m
# -------------------------
# WORKFLOWS(JOBS)
# -------------------------
workflows:
version: 2
build:
jobs:
- main-linux
- mainmacos:
name: main-macos-e2e