@@ -5,20 +5,20 @@ permissions:
5
5
on :
6
6
workflow_call :
7
7
inputs :
8
- app_repository :
9
- description : ' The repository of the application to build and test'
8
+ app_name :
9
+ description : ' The name of the application to build and test'
10
10
required : true
11
11
type : string
12
- app_branch_name :
12
+ app_branch :
13
13
description : ' The branch of the application to build and test'
14
14
required : true
15
15
type : string
16
16
workflow_dispatch :
17
17
inputs :
18
- app_repository :
19
- description : ' The repository of the application to build and test'
18
+ app_name :
19
+ description : ' The name of the application to build and test'
20
20
required : true
21
- app_branch_name :
21
+ app_branch :
22
22
description : ' The branch of the application to build and test'
23
23
required : true
24
24
# schedule:
33
33
name : Retrieve application metadata
34
34
uses : LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml@v1
35
35
with :
36
- app_repository : ${{ inputs.app_repository }}
37
- app_branch_name : ${{ inputs.app_branch_name }}
36
+ app_repository : LedgerHQ/ ${{ inputs.app_name }}
37
+ app_branch_name : ${{ inputs.app_branch }}
38
38
39
39
build_with_last_nightly :
40
40
needs : call_get_app_metadata
@@ -55,19 +55,39 @@ jobs:
55
55
- name : Checkout Code
56
56
uses : actions/checkout@v4
57
57
with :
58
- repository : ${{ inputs.app_repository }}
59
- ref : ${{ inputs.app_branch_name }}
58
+ repository : LedgerHQ/${{ inputs.app_name }}
59
+ ref : ${{ inputs.app_branch }}
60
+ path : ${{ inputs.app_name }}
61
+ submodules : true
60
62
61
- - name : Patch Cargo.toml to use y333/nightly_support for ledger_device_sdk and include_gif crate
63
+ - name : Patch Cargo.toml to use y333/nightly_support for ledger_device_sdk, ledger_secure_sdk_sys, include_gif crates
62
64
run : |
63
- cd ${{ needs.call_get_app_metadata.outputs.build_directory }}
64
- sed -i 's|ledger_device_sdk = ".*"|ledger_device_sdk = { git = "https://github.com/LedgerHQ/ledger-device-rust-sdk.git", branch = "y333/nightly_support" }|' Cargo.toml
65
- sed -i 's|include_gif = ".*"|include_gif = { git = "https://github.com/LedgerHQ/ledger-device-rust-sdk.git", branch = "y333/nightly_support" }|' Cargo.toml
65
+ cd ${{ inputs.app_name }}/${{ needs.call_get_app_metadata.outputs.build_directory }}
66
+
67
+ # Patch include_gif
68
+ echo "" >> Cargo.toml && \
69
+ echo "[patch.crates-io.include_gif]" >> Cargo.toml && \
70
+ echo "git = \"https://github.com/LedgerHQ/ledger-device-rust-sdk.git\"" >> Cargo.toml && \
71
+ echo "branch = \"y333/nightly_support\"" >> Cargo.toml
72
+
73
+ # Patch ledger_secure_sdk_sys
74
+ echo "" >> Cargo.toml && \
75
+ echo "[patch.crates-io.ledger_secure_sdk_sys]" >> Cargo.toml && \
76
+ echo "git = \"https://github.com/LedgerHQ/ledger-device-rust-sdk.git\"" >> Cargo.toml && \
77
+ echo "branch = \"y333/nightly_support\"" >> Cargo.toml
78
+
79
+ # Patch ledger_device_sdk
80
+ echo "" >> Cargo.toml && \
81
+ echo "[patch.crates-io.ledger_device_sdk]" >> Cargo.toml && \
82
+ echo "git = \"https://github.com/LedgerHQ/ledger-device-rust-sdk.git\"" >> Cargo.toml && \
83
+ echo "branch = \"y333/nightly_support\"" >> Cargo.toml
84
+
66
85
echo "Display patched Cargo.toml:"
67
86
cat Cargo.toml
68
87
69
88
- name : Build
70
89
run : |
90
+ cd ${{ inputs.app_name }}/${{ needs.call_get_app_metadata.outputs.build_directory }}
71
91
cargo update include_gif
72
92
cargo update ledger_secure_sdk_sys
73
93
cargo update ledger_device_sdk
@@ -91,10 +111,35 @@ jobs:
91
111
- name : Upload binary artifacts
92
112
uses : actions/upload-artifact@v4
93
113
with :
94
- name : " app_binaries -${{ matrix.device }}"
114
+ name : " ${{ inputs.app_name }}_binaries -${{ matrix.device }}"
95
115
path : ${{env.BINARY_PATH}}
96
116
if-no-files-found : error
97
117
118
+ build_check_signature_starknet :
119
+ name : Build binary used to check signture during the test
120
+ if : ${{ inputs.app_name == 'app-starknet' }}
121
+ runs-on : ubuntu-latest
122
+ container :
123
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
124
+ steps :
125
+ - name : Clone
126
+ uses : actions/checkout@v4
127
+ with :
128
+ repository : LedgerHQ/${{ inputs.app_name }}
129
+ ref : ${{ inputs.app_branch }}
130
+ path : ${{ inputs.app_name }}
131
+ submodules : true
132
+ - name : Build
133
+ working-directory : ${{ inputs.app_name }}/tools/check-signature
134
+ run : |
135
+ cargo build
136
+ - name : Upload app binary
137
+ uses : actions/upload-artifact@v4
138
+ with :
139
+ name : check-signature
140
+ path : ${{ inputs.app_name }}/tools/check-signature/target/debug/check-signature
141
+ if-no-files-found : error
142
+
98
143
merge_artifacts :
99
144
name : Merge build artifacts
100
145
needs : build_with_last_nightly
@@ -103,15 +148,28 @@ jobs:
103
148
- name : Merge artifacts
104
149
uses : actions/upload-artifact/merge@v4
105
150
with :
106
- name : " app_binaries "
107
- pattern : " app_binaries -*"
151
+ name : " ${{ inputs.app_name }}_binaries "
152
+ pattern : " ${{ inputs.app_name }}_binaries -*"
108
153
delete-merged : true
109
154
110
155
ragger_tests :
111
156
name : Run ragger tests using the reusable workflow
157
+ if : ${{ inputs.app_name != 'app-starknet' }}
112
158
needs : merge_artifacts
113
159
uses : LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
114
160
with :
115
- app_repository : ${{ inputs.app_repository }}
116
- app_branch_name : ${{ inputs.app_branch_name }}
117
- download_app_binaries_artifact : " app_binaries"
161
+ app_repository : LedgerHQ/${{ inputs.app_name }}
162
+ app_branch_name : ${{ inputs.app_branch }}
163
+ download_app_binaries_artifact : " ${{ inputs.app_name }}_binaries"
164
+
165
+ ragger_tests_starknet :
166
+ name : Run ragger tests using the reusable workflow
167
+ if : ${{ inputs.app_name == 'app-starknet' }}
168
+ needs : [merge_artifacts, build_check_signature_starknet]
169
+ uses : LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
170
+ with :
171
+ app_repository : LedgerHQ/${{ inputs.app_name }}
172
+ app_branch_name : ${{ inputs.app_branch }}
173
+ download_app_binaries_artifact : " ${{ inputs.app_name }}_binaries"
174
+ additional_app_binaries_artifact : " check-signature"
175
+ additional_app_binaries_artifact_dir : " tools/check-signature/target/debug"
0 commit comments