Skip to content

Commit 68fc4ad

Browse files
committed
Update after PR review
1 parent a3651ff commit 68fc4ad

File tree

2 files changed

+49
-59
lines changed

2 files changed

+49
-59
lines changed

.github/workflows/get_rust_apps.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
print("Usage: get_rust_apps.py <github_token>")
99
sys.exit(1)
1010

11-
ledger_devices = ["nanos+", "nanox", "stax", "flex"]
12-
filtered_apps = ["app-kadena-legacy", "app-pocket"]
11+
# Excluded Rust apps
12+
# app-kadena-legacy: has been replaced by app-kadena
13+
# app-pocket: does not build (Obsidians' Alamgu issue)
14+
excluded_apps = ["app-kadena-legacy", "app-pocket"]
1315

14-
# Retrieve all apps on LedgerHQ GitHub organization
16+
# Excluded devices
17+
excluded_devices = ["nanos"]
18+
19+
# Retrieve all public apps on LedgerHQ GitHub organization
1520
token = sys.argv[1]
1621
gh = GitHubLedgerHQ(token)
1722
apps=gh.apps.filter(archived=Condition.WITHOUT)
@@ -29,20 +34,11 @@
2934
else:
3035
# Filter out apps that are Rust based
3136
if manifest.app.sdk == "rust":
32-
rust_apps.append(app.name)
33-
# filter out app for specific devices
34-
for d in ledger_devices:
35-
if d not in manifest.app.devices or app.name in filtered_apps:
36-
exclude_apps.append({"app-name": app.name, "device": d})
37+
if app.name not in excluded_apps:
38+
for d in manifest.app.devices:
39+
if d not in excluded_devices:
40+
rust_apps.append({"app-name": app.name, "device": d})
3741

38-
# save the list of Rust apps in a json format:
42+
# save the list of (apps, device) pairs to build in a json format:
3943
with open("rust_apps.json", "w") as f:
40-
f.write(json.dumps(rust_apps))
41-
42-
# save the list of Excluded apps in a json format:
43-
with open("exclude_apps.json", "w") as f:
44-
f.write(json.dumps(exclude_apps))
45-
46-
# save the list of Ledger devices in a json format:
47-
with open("ledger_devices.json", "w") as f:
48-
f.write(json.dumps(ledger_devices))
44+
f.write(json.dumps(rust_apps))

.github/workflows/reusable_build_all_apps.yml

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,54 +31,48 @@ jobs:
3131
echo "repo=${{ github.repository}}" >> $GITHUB_OUTPUT
3232
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
3333
fi
34-
# retrieve-rust-apps:
35-
# name: Retrieve Rust Apps
36-
# runs-on: ubuntu-latest
37-
# needs: how-workflow-is-called
38-
# outputs:
39-
# rust_apps: ${{ steps.get_rust_apps.outputs.rust_apps }}
40-
# steps:
41-
# - name: Checkout repository
42-
# uses: actions/checkout@v4
43-
# with:
44-
# repository: ${{ needs.how-workflow-is-called.outputs.repository }}
45-
# ref: ${{ needs.how-workflow-is-called.outputs.branch }}
46-
# - name: Set up Python
47-
# uses: actions/setup-python@v4
48-
# with:
49-
# python-version: '3.x'
50-
# - name: Install ledgered
51-
# run: pip install ledgered
52-
# - name: Get all rust apps
53-
# id: get_rust_apps
54-
# run: |
55-
# python .github/workflows/get_rust_apps.py ${{ secrets.GITHUB_TOKEN }}
56-
# echo "rust_apps=$(cat rust_apps.json)" >> $GITHUB_OUTPUT
34+
retrieve-rust-apps:
35+
name: Retrieve Rust Apps
36+
runs-on: ubuntu-latest
37+
needs: how-workflow-is-called
38+
outputs:
39+
rust_apps: ${{ steps.get_rust_apps.outputs.rust_apps }}
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
with:
44+
repository: ${{ needs.how-workflow-is-called.outputs.repository }}
45+
ref: ${{ needs.how-workflow-is-called.outputs.branch }}
46+
- name: Set up Python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.x'
50+
- name: Install ledgered
51+
run: pip install ledgered
52+
- name: Get all rust apps
53+
id: get_rust_apps
54+
run: |
55+
python .github/workflows/get_rust_apps.py ${{ secrets.GITHUB_TOKEN }}
56+
echo "rust_apps=$(cat rust_apps.json)" >> $GITHUB_OUTPUT
5757
58-
# display-rust-apps:
59-
# name: Display Rust Apps
60-
# runs-on: ubuntu-latest
61-
# needs: retrieve-rust-apps
62-
# steps:
63-
# - name: Display Rust Apps
64-
# run: |
65-
# echo "Rust apps: ${{ needs.retrieve-rust-apps.outputs.rust_apps }}"
58+
display-rust-apps:
59+
name: Display Rust Apps
60+
runs-on: ubuntu-latest
61+
needs: retrieve-rust-apps
62+
steps:
63+
- name: Display Rust Apps
64+
run: |
65+
echo "Rust apps: ${{ needs.retrieve-rust-apps.outputs.rust_apps }}"
6666
6767
test-build:
6868
name: Build for all targets
69-
# needs: [retrieve-rust-apps, how-workflow-is-called]
70-
needs: [how-workflow-is-called]
69+
needs: [retrieve-rust-apps, how-workflow-is-called]
7170
strategy:
7271
fail-fast: false
7372
matrix:
74-
app-name: []
75-
device: []
76-
# include: ${{ fromJSON(needs.retrieve-rust-apps.outputs.rust_apps) }}
77-
include:
78-
- app-name: "app-boilerplate-rust"
79-
device: "nanos+"
80-
- app-name: "app-starknet"
81-
device: "nanos+"
73+
app-name: ["app-boilerplate-rust"]
74+
device: ["nanos+", "nanox", "stax", "flex"]
75+
include: ${{ fromJSON(needs.retrieve-rust-apps.outputs.rust_apps) }}
8276
runs-on: ubuntu-latest
8377
container:
8478
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

0 commit comments

Comments
 (0)