-
Notifications
You must be signed in to change notification settings - Fork 92
258 lines (206 loc) · 7.13 KB
/
check_pr.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
name: Check PR
on:
pull_request:
branches:
- master
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
env:
FLUTTER_VERSION: "3.24.3"
DART_VERSION: "3.4.3"
DCM_VERSION: "1.17.0"
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1.6.5
with:
sdk: ${{ env.DART_VERSION }}
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
dart_libs:
needs: [formatting]
runs-on: ubuntu-latest
env:
SCOPE: --no-flutter --ignore="solana"
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1.6.5
with:
sdk: ${{ env.DART_VERSION }}
- name: Install DCM
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.DCM_VERSION }}
- name: Activate utils
run: make activate_utils
- name: Install dependencies
run: melos bs ${{ env.SCOPE }}
- name: Analyze project source
run: melos exec -c 1 ${{ env.SCOPE }} -- make dart_analyze
- name: Run tests
run: melos exec -c 1 ${{ env.SCOPE }} --dir-exists="test" -- make dart_test
solana:
needs: [formatting]
strategy:
fail-fast: false
matrix:
solanaVersion: ["stable", "beta"]
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
env:
DEVNET_RPC_URL: "http://localhost:8899"
DEVNET_WEBSOCKET_URL: "ws://localhost:8900"
SCOPE: --scope="solana"
METAPLEX_ID: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
METAPLEX_SO: "packages/solana/test/bpf-programs/metaplex.so"
steps:
- uses: actions/checkout@v4
- run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Install DCM
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.DCM_VERSION }}
- name: Activate utils
run: make activate_utils
- name: Start Solana Local Validator
uses: ./.github/solana_local_validator
with:
solana-version: ${{ matrix.solanaVersion }}
cluster: mainnet
args: --bpf-program ${{ env.METAPLEX_ID }} ${{ env.METAPLEX_SO }}
- name: Install dependencies
run: melos exec -c 1 ${{ env.SCOPE }} -- make dart_get
- name: Analyze
run: melos exec -c 1 ${{ env.SCOPE }} -- make dart_analyze
- name: Test
run: melos exec -c 1 ${{ env.SCOPE }} -- dart run test --coverage=coverage
- name: Coverage
run: melos exec -c 1 ${{ env.SCOPE }} -- make dart_coverage
- uses: codecov/codecov-action@v4
with:
flags: solana-${{ matrix.solanaVersion }}
solana_mobile:
needs: [formatting]
runs-on: ubuntu-latest
env:
SCOPE: --scope="solana_mobile_*" --scope="solana_seed_vault"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install DCM
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.DCM_VERSION }}
- name: Activate utils
run: make activate_utils
- name: Install dependencies
run: melos exec -c 1 ${{ env.SCOPE }} -- make flutter_get
- name: Analyze
run: melos exec -c 1 ${{ env.SCOPE }} -- make flutter_analyze
- name: Test
run: melos exec -c 1 ${{ env.SCOPE }} --dir-exists="test" -- make flutter_test
espressocash_app:
needs: [formatting]
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
env:
SOLANA_RPC_URL: "http://localhost:8899"
SOLANA_WEBSOCKET_URL: "ws://localhost:8900"
SCOPE: --scope="espressocash_app"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Install DCM
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.DCM_VERSION }}
- name: Activate utils
run: make activate_utils
- name: Start Solana Local Validator
uses: ./.github/solana_local_validator
with:
solana-version: stable
cluster: mainnet
- name: Install dependencies
run: melos bs ${{ env.SCOPE }}
- name: Generate code
run: |
melos exec -c 1 ${{ env.SCOPE }} --depends-on="flutter_localizations" -- flutter gen-l10n
melos exec -c 1 ${{ env.SCOPE }} --depends-on="build_runner" -- make flutter_build
- name: Generate test schemas
run: melos exec -c 1 ${{ env.SCOPE }} --depends-on="drift_dev" -- make flutter_generate_test_schemas
- name: Analyze
run: |
pip3 install networkx graphviz pydot pydotplus
melos exec -c 1 ${{ env.SCOPE }} -- make flutter_analyze
melos exec -c 1 ${{ env.SCOPE }} -- make deps_graph_all
melos exec -c 1 ${{ env.SCOPE }} -- make deps_graph_features
- name: Test
run: melos exec -c 1 ${{ env.SCOPE }} --dir-exists="test" -- make flutter_test
- name: Store failure artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: golden-test-failure
path: "**/test/golden/**/failures/"
espressocash_landing:
needs: [formatting]
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
env:
SCOPE: --scope="espressocash_landing"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Install DCM
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.DCM_VERSION }}
- name: Activate utils
run: make activate_utils
- name: Install dependencies
run: melos bs ${{ env.SCOPE }}
- name: Generate code
run: |
melos exec -c 1 ${{ env.SCOPE }} --depends-on="flutter_localizations" -- flutter gen-l10n
melos exec -c 1 ${{ env.SCOPE }} --depends-on="build_runner" -- make flutter_build
- name: Generate test schemas
run: melos exec -c 1 ${{ env.SCOPE }} --depends-on="drift_dev" -- make flutter_generate_test_schemas
- name: Analyze
run: |
melos exec -c 1 ${{ env.SCOPE }} -- make flutter_analyze
melos exec -c 1 ${{ env.SCOPE }} -- make deps_graph_all
- name: Test
run: melos exec -c 1 ${{ env.SCOPE }} --dir-exists="test" -- make flutter_test
- name: Store failure artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: golden-test-failure
path: "**/test/golden/**/failures/"