Skip to content

Commit 2670080

Browse files
authored
Merge pull request #265 from LedgerHQ/y333/update_ci
Choose C SDK branch when building all Rust apps in CI
2 parents f3866ed + cecd10a commit 2670080

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@ jobs:
7474
working-directory: ledger_device_sdk
7575
run: |
7676
cargo test --target ${{ matrix.target }} --features speculos --tests
77+
78+
build-apps:
79+
name: Build all Rust apps
80+
uses: ./.github/workflows/reusable_build_all_apps.yml
81+
with:
82+
rust_sdk_branch: ${{ github.ref }}

.github/workflows/reusable_build_all_apps.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,36 @@ on:
77
required: false
88
default: ''
99
type: string
10+
rust_sdk_branch:
11+
required: false
12+
default: 'master'
13+
type: string
1014
workflow_dispatch:
11-
pull_request:
15+
inputs:
16+
c_sdk_branch:
17+
required: false
18+
default: ''
19+
type: string
20+
rust_sdk_branch:
21+
required: false
22+
default: 'master'
23+
type: string
1224

1325
env:
1426
C_SDK_URL: 'https://github.com/LedgerHQ/ledger-secure-sdk.git'
1527

16-
jobs:
17-
how-workflow-is-called:
18-
name: Determine how the workflow is called
19-
runs-on: ubuntu-latest
20-
outputs:
21-
repository: ${{ steps.get_repo_and_branch.outputs.repo }}
22-
branch: ${{ steps.get_repo_and_branch.outputs.branch }}
23-
steps:
24-
- name: Get repository and branch
25-
id: get_repo_and_branch
26-
run: |
27-
if [ -n "${{ inputs.c_sdk_branch }}" ]; then
28-
echo "repo=LedgerHQ/ledger-device-rust-sdk" >> $GITHUB_OUTPUT
29-
echo "branch=master" >> $GITHUB_OUTPUT
30-
else
31-
echo "repo=${{ github.repository}}" >> $GITHUB_OUTPUT
32-
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
33-
fi
28+
jobs:
3429
retrieve-rust-apps:
3530
name: Retrieve Rust Apps
3631
runs-on: ubuntu-latest
37-
needs: how-workflow-is-called
3832
outputs:
3933
rust_apps: ${{ steps.get_rust_apps.outputs.rust_apps }}
4034
steps:
4135
- name: Checkout repository
4236
uses: actions/checkout@v4
4337
with:
44-
repository: ${{ needs.how-workflow-is-called.outputs.repository }}
45-
ref: ${{ needs.how-workflow-is-called.outputs.branch }}
38+
repository: LedgerHQ/ledger-device-rust-sdk
39+
ref: ${{ inputs.rust_sdk_branch }}
4640
- name: Set up Python
4741
uses: actions/setup-python@v4
4842
with:
@@ -66,7 +60,7 @@ jobs:
6660
6761
test-build:
6862
name: Build for all targets
69-
needs: [retrieve-rust-apps, how-workflow-is-called]
63+
needs: [retrieve-rust-apps]
7064
strategy:
7165
fail-fast: false
7266
matrix:
@@ -83,8 +77,8 @@ jobs:
8377
uses: actions/checkout@v4
8478
with:
8579
path: sdk
86-
repository: ${{ needs.how-workflow-is-called.outputs.repository }}
87-
ref: ${{ needs.how-workflow-is-called.outputs.branch }}
80+
repository: LedgerHQ/ledger-device-rust-sdk
81+
ref: ${{ inputs.rust_sdk_branch }}
8882
- name: Clone App
8983
uses: actions/checkout@v4
9084
with:

0 commit comments

Comments
 (0)