Skip to content

Commit 5f9b742

Browse files
ci: use --release-packaging flag for SDK
Recently added a new flag --release-packaging to build_sdk.py that makes it easier to build all the SDKs for each target. This is a lot quicker than calling build_sdk.py multiple times since this will just build all artifacts once (e.g the kernel, libmicrokit) and simply make copies of the SDK with a different target for the tool since the tool is the only host-specific part. The benefit of this is that for all users of the SDK, regardless of their host platform, they will be using the exact same artifacts (expect for the tool of course). This should cut down CI time a fair bit. Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
1 parent 8f044b2 commit 5f9b742

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

.github/workflows/sdk.yaml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ jobs:
4747
rustup default 1.90.0
4848
rustup target add x86_64-unknown-linux-musl
4949
rustup component add rust-src --toolchain 1.90.0-x86_64-unknown-linux-gnu
50-
rustup target add aarch64-unknown-linux-musl
51-
rustup component add rust-src --toolchain 1.90.0-aarch64-unknown-linux-musl
5250
sudo apt update
5351
sudo apt install software-properties-common
5452
sudo add-apt-repository ppa:deadsnakes/ppa
@@ -73,18 +71,9 @@ jobs:
7371
run: echo "SDK_VERSION=$(./ci/dev_version.sh)" >> $GITHUB_ENV
7472
- name: Build SDK (x86-64)
7573
run: ./pyenv/bin/python build_sdk.py --sel4=seL4 --version ${{ env.SDK_VERSION }}-linux-x86-64 --tool-target-triple="x86_64-unknown-linux-musl"
76-
- name: Upload SDK (x86-64)
77-
uses: actions/upload-artifact@v4
78-
with:
79-
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64
80-
path: release/microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz
81-
- name: Build SDK (ARM64)
82-
run: ./pyenv/bin/python build_sdk.py --sel4=seL4 --version ${{ env.SDK_VERSION }}-linux-aarch64 --tool-target-triple="aarch64-unknown-linux-musl"
83-
- name: Upload SDK (ARM64)
84-
uses: actions/upload-artifact@v4
85-
with:
86-
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-aarch64
87-
path: release/microkit-sdk-${{ env.SDK_VERSION }}-linux-aarch64.tar.gz
74+
# The macOS run is slightly different to Linux since it also produces the
75+
# per-commit builds of the SDK and uploading them to GitHub for all supported
76+
# targets.
8877
build_macos:
8978
name: Build SDK (macOS x86-64, ARM64)
9079
runs-on: [self-hosted, macos, ARM64]
@@ -104,17 +93,25 @@ jobs:
10493
run: nix develop -c bash -c 'echo Hello World'
10594
- name: Set version
10695
run: echo "SDK_VERSION=$(./ci/dev_version.sh)" >> $GITHUB_ENV
107-
- name: Build SDK (x86-64)
108-
run: nix develop --ignore-environment -c bash -c "python3 build_sdk.py --sel4=seL4 --version ${{ env.SDK_VERSION }}-macos-x86-64 --gcc-toolchain-prefix-x86_64 x86_64-elf --gcc-toolchain-prefix-riscv64 riscv64-none-elf --tool-target-triple=x86_64-apple-darwin"
109-
- name: Upload SDK (x86-64)
96+
- name: Build SDK
97+
run: nix develop --ignore-environment -c bash -c "python3 build_sdk.py --sel4=seL4 --version ${{ env.SDK_VERSION }} --gcc-toolchain-prefix-x86_64 x86_64-elf --gcc-toolchain-prefix-riscv64 riscv64-none-elf"
98+
- name: Upload SDK (macos-aarch64)
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: microkit-sdk-${{ env.SDK_VERSION }}-macos-aarch64
102+
path: release/microkit-sdk-${{ env.SDK_VERSION }}-macos-aarch64.tar.gz
103+
- name: Upload SDK (macos-x86-64)
110104
uses: actions/upload-artifact@v4
111105
with:
112106
name: microkit-sdk-${{ env.SDK_VERSION }}-macos-x86-64
113107
path: release/microkit-sdk-${{ env.SDK_VERSION }}-macos-x86-64.tar.gz
114-
- name: Build SDK (ARM64)
115-
run: nix develop --ignore-environment -c bash -c "python3 build_sdk.py --sel4=seL4 --version ${{ env.SDK_VERSION }}-macos-aarch64 --gcc-toolchain-prefix-x86_64 x86_64-elf --gcc-toolchain-prefix-riscv64 riscv64-none-elf --tool-target-triple=aarch64-apple-darwin"
116-
- name: Upload SDK (ARM64)
108+
- name: Upload SDK (linux-aarch64)
117109
uses: actions/upload-artifact@v4
118110
with:
119-
name: microkit-sdk-${{ env.SDK_VERSION }}-macos-aarch64
120-
path: release/microkit-sdk-${{ env.SDK_VERSION }}-macos-aarch64.tar.gz
111+
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-aarch64
112+
path: release/microkit-sdk-${{ env.SDK_VERSION }}-linux-aarch64.tar.gz
113+
- name: Upload SDK (linux-x86-64)
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64
117+
path: release/microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz

0 commit comments

Comments
 (0)