1
- name : Substrate Connect CI
1
+ name : Continuous Integration and Deployment
2
2
3
3
on :
4
4
push :
5
5
branches : [ main ]
6
- pull_request :
7
- branches : [ main ]
8
6
9
7
permissions :
10
8
contents : write
@@ -13,82 +11,13 @@ permissions:
13
11
pull-requests : write
14
12
15
13
jobs :
16
- build :
17
- runs-on : ubuntu-latest
18
-
19
- strategy :
20
- matrix :
21
- node-version : [18.x, 20.x]
22
-
23
- steps :
24
- - uses : actions/checkout@v4.1.7
25
- - uses : ./.github/actions/turbo-build
26
- with :
27
- node-version : ${{ matrix.node-version }}
28
-
29
- playwright-test-extension :
30
- needs : [build]
31
- timeout-minutes : 10
32
- runs-on : ubuntu-latest
33
- steps :
34
- - uses : actions/checkout@v4.1.7
35
- - uses : ./.github/actions/turbo-build
36
- - name : Build extension with Manifest v3 for Chrome
37
- run : pnpm build:chrome
38
- working-directory : ./projects/extension
39
- - run : pnpm playwright:install
40
- working-directory : ./projects/extension
41
- - name : Test projects/extension
42
- run : pnpm playwright:chromium --trace on
43
- working-directory : ./projects/extension
44
- - uses : actions/upload-artifact@v4
45
- if : failure()
46
- with :
47
- name : playwright-report-substrate-connect-extension-mv3-chrome
48
- path : ./projects/extension/playwright-report
49
-
50
- playwright-test-examples :
51
- needs : [build]
52
- timeout-minutes : 10
53
- runs-on : ubuntu-latest
54
- steps :
55
- - uses : actions/checkout@v4.1.7
56
- - uses : ./.github/actions/turbo-build
57
- - run : pnpm playwright:install
58
- working-directory : ./examples/light-client-extension-helpers-extension
59
- - name : Test examples/light-client-extension-helpers-extension
60
- run : pnpm playwright:chromium --trace on
61
- working-directory : ./examples/light-client-extension-helpers-extension
62
- - uses : actions/upload-artifact@v4
63
- if : failure()
64
- with :
65
- name : playwright-report-light-client-extension-helpers-extension-mv3-chrome
66
- path : ./examples/light-client-extension-helpers-extension/playwright-report
67
-
68
- playwright-test-wallet-template :
69
- needs : [build]
70
- timeout-minutes : 10
71
- runs-on : ubuntu-latest
72
- steps :
73
- - uses : actions/checkout@v4.1.7
74
- - uses : ./.github/actions/turbo-build
75
- - name : Build extension with Manifest v3 for Chrome
76
- run : pnpm build:chrome
77
- working-directory : ./projects/wallet-template
78
- - run : pnpm playwright:install
79
- working-directory : ./projects/wallet-template
80
- - name : Test projects/wallet-template
81
- run : pnpm playwright:chromium --trace on
82
- working-directory : ./projects/wallet-template
83
- - uses : actions/upload-artifact@v4
84
- if : failure()
85
- with :
86
- name : playwright-report-substrate-connect-wallet-template-mv3-chrome
87
- path : ./projects/wallet-template/playwright-report
14
+ run-ci :
15
+ uses : ./.github/workflows/reusable-ci.yml
16
+ with :
17
+ upload-artifacts : true
88
18
89
19
changesets :
90
- if : github.ref == 'refs/heads/main'
91
- needs : [build]
20
+ needs : [run-ci]
92
21
runs-on : ubuntu-latest
93
22
steps :
94
23
- name : Generate a token
109
38
GITHUB_TOKEN : ${{ steps.gen_token.outputs.token }}
110
39
111
40
npm-publish :
112
- if : github.ref == 'refs/heads/main'
113
- needs : [build]
41
+ needs : [run-ci]
114
42
runs-on : ubuntu-latest
115
43
steps :
116
44
- uses : actions/checkout@v4.1.7
167
95
package-directory : ./packages/smoldot-discovery-connector
168
96
169
97
upload-extension-artifacts :
170
- if : github.ref == 'refs/heads/main'
171
- needs : [build]
98
+ needs : [run-ci]
172
99
runs-on : ubuntu-latest
173
100
steps :
174
101
- uses : actions/checkout@v4.1.7
@@ -189,32 +116,31 @@ jobs:
189
116
path : ./projects/extension/dist
190
117
191
118
docs :
192
- if : github.ref == 'refs/heads/main'
193
- needs : [build]
119
+ needs : [run-ci]
194
120
runs-on : ubuntu-latest
195
121
steps :
196
122
- uses : actions/checkout@v4.1.7
197
123
- uses : ./.github/actions/turbo-build
198
124
- name : Generate API Docs
199
125
run : pnpm api-docs
200
-
201
126
- name : Setup Pages
202
127
uses : actions/configure-pages@v3
203
-
204
128
- name : Upload artifact
205
129
uses : actions/upload-pages-artifact@v2
206
130
with :
207
- # Upload entire repository
208
131
path : ' ./docs'
209
-
210
132
- name : Deploy to GitHub Pages
211
133
id : deployment
212
134
uses : actions/deploy-pages@v2
213
135
214
136
all :
215
- # This dummy job depends on all the mandatory checks. It succeeds if and only if all CI checks
216
- # are successful.
217
- needs : [build, playwright-test-extension, playwright-test-examples, playwright-test-wallet-template]
137
+ needs : [run-ci, changesets, npm-publish, upload-extension-artifacts, docs]
218
138
runs-on : ubuntu-latest
139
+ if : always()
219
140
steps :
220
- - run : echo Success
141
+ - name : Check job status
142
+ if : contains(needs.*.result, 'failure')
143
+ run : exit 1
144
+ - name : All jobs completed successfully
145
+ if : success()
146
+ run : echo "All jobs completed successfully!"
0 commit comments