-
Notifications
You must be signed in to change notification settings - Fork 23
199 lines (174 loc) · 6.84 KB
/
pull_request.yml
File metadata and controls
199 lines (174 loc) · 6.84 KB
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
name: "[Checks] Pull Request"
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches-ignore:
- main
env:
FORCE_COLOR: "1"
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
auto-assign:
name: Auto assign
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- uses: toshimaru/auto-author-assign@v3.0.1
detect-changes:
name: Detect changed packages
runs-on: ubuntu-22.04
outputs:
context-module: ${{ steps.filter.outputs.context-module }}
signer-eth: ${{ steps.filter.outputs.signer-eth }}
signer-solana: ${{ steps.filter.outputs.signer-solana }}
signer-utils: ${{ steps.filter.outputs.signer-utils }}
solana-tools: ${{ steps.filter.outputs.solana-tools }}
cs-tester: ${{ steps.filter.outputs.cs-tester }}
should-run-ethereum-cs-tester: ${{ steps.filter.outputs.signer-eth == 'true' || steps.filter.outputs.context-module == 'true' || steps.filter.outputs.signer-utils == 'true' || steps.filter.outputs.cs-tester == 'true' }}
should-run-solana-cs-tester: ${{ steps.filter.outputs.signer-solana == 'true' || steps.filter.outputs.context-module == 'true' || steps.filter.outputs.signer-utils == 'true' || steps.filter.outputs.cs-tester == 'true' || steps.filter.outputs.solana-tools == 'true' }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
context-module:
- 'packages/signer/context-module/**'
signer-eth:
- 'packages/signer/signer-eth/**'
signer-solana:
- 'packages/signer/signer-solana/**'
signer-utils:
- 'packages/signer/signer-utils/**'
solana-tools:
- 'packages/tools/solana-tools/**'
cs-tester:
- 'apps/clear-signing-tester/**'
- '.github/**'
setup:
name: Setup toolchain and dependencies
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-cache-composite@develop
danger:
name: Run Danger check
needs: [setup]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-cache-composite@develop
- name: Danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Workaround when using custom runners
# https://github.com/danger/danger-js/issues/1374
DANGER_GITHUB_API_BASE_URL: "https://api.github.com"
run: pnpm danger:ci
build-libraries:
name: Build libraries
needs: [setup]
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-build-cache-composite@develop
build-apps:
name: Build apps
needs: [build-libraries]
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-build-cache-composite@develop
- name: Build apps
run: pnpm build
health-check:
name: Run health check
needs: [build-libraries]
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-build-cache-composite@develop
- name: Health check
id: health-check
run: pnpm health-check
tests:
name: Run unit tests
needs: [build-libraries]
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-build-cache-composite@develop
- name: Tests
id: unit-tests
run: pnpm test:coverage
- uses: sonarsource/sonarqube-scan-action@v7
if: ${{ steps.unit-tests.conclusion == 'success' && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }}
env:
SONAR_TOKEN: ${{ secrets.PUBLIC_GREEN_SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.PUBLIC_SONAR_HOST_URL }}
cs-tester:
needs: [build-libraries, detect-changes]
if: needs.detect-changes.outputs.should-run-ethereum-cs-tester == 'true'
name: Ethereum Clear Signing Test (${{ matrix.device }} - ${{ matrix.test }})
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
device: [stax, nanox]
test:
- test:raw:complete
- test:raw:multisig
- test:typed-data:multisig
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/cs-tester-composite
with:
runner: cs-tester
test: ${{ matrix.test }}
device: ${{ matrix.device }}
coin-app: Ethereum
artifact-prefix: eth-cs-tester-logs
summary-prefix: "Ethereum Clear Signing Test"
gh-bot-app-id: ${{ secrets.GH_BOT_APP_ID }}
gh-bot-private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
gating-token: ${{ secrets.GATING_TOKEN }}
solana-rpc-url: ${{ secrets.SOLANA_LEDGER_RPC_URL }}
solana-cs-tester:
needs: [build-libraries, detect-changes]
if: needs.detect-changes.outputs.should-run-solana-cs-tester == 'true'
name: Solana Fixture Test (${{ matrix.device }} - ${{ matrix.test }})
runs-on: ${{ !github.event.pull_request.head.repo.fork && 'ledgerhq-device-sdk' || 'ubuntu-22.04' }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
device: [stax, nanox]
test:
- test:solana:system-transfers
- test:solana:spl-legacy
- test:solana:spl-token2022
- test:solana:stake
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/cs-tester-composite
with:
runner: cs-tester:solana
test: ${{ matrix.test }}
device: ${{ matrix.device }}
coin-app: Solana
artifact-prefix: solana-cs-tester-logs
summary-prefix: "Solana Fixture Test"
gh-bot-app-id: ${{ secrets.GH_BOT_APP_ID }}
gh-bot-private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
gating-token: ${{ secrets.GATING_TOKEN }}
solana-rpc-url: ${{ secrets.SOLANA_LEDGER_RPC_URL }}