-
Notifications
You must be signed in to change notification settings - Fork 77
93 lines (87 loc) · 3.03 KB
/
reusable-ci.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
name: Reusable CI Workflow
on:
workflow_call:
inputs:
upload-artifacts:
type: boolean
default: false
required: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 23.x]
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
with:
node-version: ${{ matrix.node-version }}
playwright-test-extension:
needs: [build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: Build extension with Manifest v3 for Chrome
run: pnpm build:chrome
working-directory: ./projects/extension
- run: pnpm playwright:install
working-directory: ./projects/extension
- name: Test projects/extension
run: pnpm playwright:chromium --trace on
working-directory: ./projects/extension
- uses: actions/upload-artifact@v4
if: failure() || inputs.upload-artifacts
with:
name: playwright-report-substrate-connect-extension-mv3-chrome
path: ./projects/extension/playwright-report
playwright-test-examples:
needs: [build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- run: pnpm playwright:install
working-directory: ./examples/light-client-extension-helpers-extension
- name: Test examples/light-client-extension-helpers-extension
run: pnpm playwright:chromium --trace on
working-directory: ./examples/light-client-extension-helpers-extension
- uses: actions/upload-artifact@v4
if: failure() || inputs.upload-artifacts
with:
name: playwright-report-light-client-extension-helpers-extension-mv3-chrome
path: ./examples/light-client-extension-helpers-extension/playwright-report
playwright-test-wallet-template:
needs: [build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: Build extension with Manifest v3 for Chrome
run: pnpm build:chrome
working-directory: ./projects/wallet-template
- run: pnpm playwright:install
working-directory: ./projects/wallet-template
- name: Test projects/wallet-template
run: pnpm playwright:chromium --trace on
working-directory: ./projects/wallet-template
- uses: actions/upload-artifact@v4
if: failure() || inputs.upload-artifacts
with:
name: playwright-report-substrate-connect-wallet-template-mv3-chrome
path: ./projects/wallet-template/playwright-report
all:
needs: [build, playwright-test-extension, playwright-test-examples, playwright-test-wallet-template]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check job status
if: contains(needs.*.result, 'failure')
run: exit 1
- name: All jobs completed successfully
if: success()
run: echo "All jobs completed successfully!"