-
Notifications
You must be signed in to change notification settings - Fork 2.2k
205 lines (189 loc) · 7.04 KB
/
e2e-matrix.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: E2E matrix
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
e2e:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
include:
- os: ubuntu-latest
os-name: ubuntu
os-cache-dir: /tmp/nx-cache
- os: macos-latest
os-name: osx
os-cache-dir: /tmp/nx-cache
node_version:
- '16'
package_manager:
- npm
- yarn
- pnpm
packages:
- e2e-angular-core,e2e-angular-extensions
- e2e-cli,e2e-nx-plugin,e2e-jest,e2e-linter
- e2e-cypress
- e2e-react
- e2e-next
- e2e-node
- e2e-web
- e2e-storybook
- e2e-workspace-integrations,e2e-workspace-core,e2e-workspace-create
- e2e-react-native
# - e2e-detox
- e2e-add-nx-to-monorepo
exclude:
# exclude react-native and detox from ubuntu
- os: ubuntu-latest
packages: e2e-react-native
# - os: ubuntu-latest
# packages: e2e-detox
# run just npm on macos
- os: macos-latest
package_manager: yarn
- os: macos-latest
package_manager: pnpm
# exclude everything but react-native and detox from macos
- os: macos-latest
packages: e2e-workspace-core
- os: macos-latest
packages: e2e-angular-core,e2e-angular-extensions
- os: macos-latest
packages: e2e-cli,e2e-nx-plugin,e2e-jest,e2e-linter
- os: macos-latest
packages: e2e-cypress
- os: macos-latest
packages: e2e-react
- os: macos-latest
packages: e2e-next
- os: macos-latest
packages: e2e-node
- os: macos-latest
packages: e2e-web
- os: macos-latest
packages: e2e-storybook
- os: macos-latest
packages: e2e-workspace-integrations,e2e-workspace-core,e2e-workspace-create
- os: macos-latest
packages: e2e-add-nx-to-monorepo
fail-fast: false
name: ${{ matrix.os-name }}/${{ matrix.package_manager }} - ${{ matrix.packages }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install PNPM
if: ${{ matrix.package_manager == 'pnpm' }}
uses: pnpm/action-setup@v2.0.1
with:
version: 6.9.1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2.4.0
with:
node-version: ${{ matrix.node_version }}
registry-url: http://localhost:4872
- name: Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-node-${{ matrix.node_version }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ matrix.os }}-node-${{ matrix.node_version }}-yarn-
- name: Install packages
run: yarn install --prefer-offline --frozen-lockfile --non-interactive
- name: Cleanup
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# Workaround to provide additional free space for testing.
# https://github.com/actions/virtual-environments/issues/2840
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get install lsof
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Homebrew cache directory path
if: ${{ matrix.os == 'macos-latest' }}
id: homebrew-cache-dir-path
run: echo "::set-output name=dir::$(brew --cache)"
- name: Cache Homebrew
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/cache@v2
with:
path: ${{ steps.homebrew-cache-dir-path.outputs.dir }}
key: brew-${{ matrix.node_version }}
restore-keys: |
brew-
- name: Install applesimutils, reset ios simulators
if: ${{ matrix.os == 'macos-latest' }}
run: |
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
- name: Run e2e tests
run: yarn nx run-many --target=e2e --projects="${{ join(matrix.packages) }}" --parallel=1
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
NX_E2E_CI_CACHE_KEY: e2e-gha-${{ matrix.os }}-${{ matrix.node_version }}-${{ matrix.package_manager }}
NX_E2E_RUN_CYPRESS: ${{ 'true' }}
NODE_OPTIONS: --max_old_space_size=8192
SELECTED_PM: ${{ matrix.package_manager }}
npm_config_registry: http://localhost:4872
YARN_REGISTRY: http://localhost:4872
NX_VERBOSE_LOGGING: ${{ 'true' }}
NX_E2E_SKIP_BUILD_CLEANUP: ${{ 'true' }}
NX_CACHE_DIRECTORY: ${{ matrix.os-cache-dir }}
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && failure() }}
uses: mxschmitt/action-tmate@v3.8
report-success:
if: ${{ github.repository_owner == 'nrwl' && github.event_name == 'workflow_dispatch' }} # only once it's fixed on manual dispatch
needs: e2e
runs-on: ubuntu-latest
name: Report success
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ needs.e2e.result }}
message_format: '{emoji} *{workflow}* {status_message} (last commit <{commit_url}|{commit_sha}>)'
notification_title: '{workflow} has {status_message}'
footer: '<{run_url}|View Run>'
mention_users: 'U01UELKLYF2,U9NPA6C90'
mention_users_when: 'failure,warnings'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
report:
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: e2e
runs-on: ubuntu-latest
name: Report status
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ needs.e2e.result }}
message_format: '{emoji} *{workflow}* {status_message} (last commit <{commit_url}|{commit_sha}>)'
notification_title: '{workflow} has {status_message}'
footer: '<{run_url}|View Run>'
mention_users: 'U01UELKLYF2,U9NPA6C90'
mention_users_when: 'failure,warnings'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}