-
Notifications
You must be signed in to change notification settings - Fork 2.7k
168 lines (147 loc) · 5.53 KB
/
e2e-mfsu.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
name: e2e-mfsu
env:
NODE_OPTIONS: --max-old-space-size=6144
on:
schedule:
- cron: '0 */4 * * *'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
types:
- 'opened'
- 'synchronize'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
e2e-mfsu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
mfsu-strategy: [normal, eager]
os: [ubuntu-latest, windows-latest]
node-version: [16.x]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
- name: Setup Global Cypress-cache-folder in Windows
if: matrix.os == 'windows-latest'
run: echo "CYPRESS_CACHE_FOLDER=${HOME}\.cache\Cypress" >> $env:GITHUB_ENV
# We use week in the turbo cache key to keep the cache from infinitely growing
- name: Get cache expires mark (non-windows)
if: runner.os != 'Windows'
run: echo "EXPIRES_WEEK_MARK=$(date +%U)" >> $GITHUB_OUTPUT
- name: Get cache expires mark (windows)
if: runner.os == 'Windows'
run: echo "EXPIRES_WEEK_MARK=$(date +%U)" >> $env:GITHUB_OUTPUT
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ env.EXPIRES_WEEK_MARK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ runner.os }}-node${{ matrix.node-version }}-
turbo-${{ github.job }}-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ env.EXPIRES_WEEK_MARK }}-
- name: Install dependencies
run: pnpm i
- name: Build targets
run: pnpm umi-scripts turbo build --filter ./examples/mfsu-e2e... --filter ./examples/max... --filter ./examples/mf-remote...
- name: set mfsu-${{ matrix.mfsu-strategy }}-webpack
run: |
npx rimraf node_modules/.cache
npm run set:mfsu:${{ matrix.mfsu-strategy }}:webpack
cat .umirc.ts
working-directory: ./examples/mfsu-e2e
- name: e2e:example:mfsu-e2e-${{ matrix.mfsu-strategy }}-webpack
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/mfsu-e2e
install: false
install-command: pnpm i cypress
command: npm run e2e:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: set mfsu-${{ matrix.mfsu-strategy }}-esbuild
run: |
npx rimraf node_modules/.cache
npm run set:mfsu:${{ matrix.mfsu-strategy }}:esbuild
cat .umirc.ts
working-directory: ./examples/mfsu-e2e
- name: e2e:example:mfsu-e2e-${{ matrix.mfsu-strategy }}-esbuild
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/mfsu-e2e
install: false
install-command: pnpm i cypress
command: npm run e2e:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: set mfsu-${{ matrix.mfsu-strategy }}-webpack
run: |
npx rimraf node_modules/.cache
npm run set:mfsu:${{ matrix.mfsu-strategy }}:webpack
cat .umirc.ts
working-directory: ./examples/mfsu-e2e
- name: e2e:example:plugin-mf+MFSU
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/mf-remote
install: false
install-command: pnpm i cypress
command: npm run e2e:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: e2e:example:plugin-mf-host
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/mf-host
install: false
install-command: pnpm i cypress
command: npm run e2e:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: e2e:example:mfsu-independent-e2e
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/mfsu-independent-e2e
install: false
install-command: pnpm i cypress
command: npm run e2e:ci
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: e2e:example:mfsu-independent-e2e:esbuild
uses: cypress-io/github-action@v4
with:
browser: chrome
working-directory: ./examples/mfsu-independent-e2e
install: false
install-command: pnpm i cypress
command: npm run e2e:ci:esbuild
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_KEY}}
- name: Notify Contributor Group
if: ${{ failure() && github.event.schedule == '0 */4 * * *' }}
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TOKEN }}
body: ${{ format('{{"msgtype":"link","link":{{"text":"哪位好心人来看看吧!","title":"Umi CI E2E 测试失败({1})","picUrl":"","messageUrl":"https://github.com/umijs/umi/actions/runs/{0}"}}}}', github.run_id, matrix.os )}}