Skip to content

Commit bc4749e

Browse files
committed
GitHub CI/CD: Run the checks on the "arm64" (aarch64) architecture too.
1 parent a266932 commit bc4749e

4 files changed

Lines changed: 48 additions & 24 deletions

File tree

.github/workflows/cargo-workflow.yaml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
TOOLCHAIN_MAX:
1010
required: false
1111
type: string
12-
default: "1.92.0"
12+
default: "1.93.0"
1313
OS_VERS_MIN:
1414
required: false
1515
type: string
@@ -49,16 +49,21 @@ jobs:
4949
matrix:
5050
platform: ["${{ inputs.OS_VERS_MIN }}", "${{ inputs.OS_VERS_MAX }}"]
5151
rust: ["${{ inputs.TOOLCHAIN_MIN }}", "${{ inputs.TOOLCHAIN_MAX }}", "nightly"]
52-
runs-on: ubuntu-${{ matrix.platform }}
52+
architecture: [amd64, arm64]
53+
runs-on: ubuntu-${{ matrix.architecture == 'arm64' && format('{0}-arm', matrix.platform) || matrix.platform }}
5354
steps:
5455
- uses: actions/checkout@v4
5556
- uses: actions-rust-lang/setup-rust-toolchain@v1
5657
with:
5758
toolchain: ${{ matrix.rust }}
5859
cache: false
59-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
60+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
6061
with:
61-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
62+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
63+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
64+
- run: |
65+
pkgconf --path tss2-fapi
66+
pkgconf --cflags --libs tss2-fapi
6267
- run: make check
6368

6469
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -71,16 +76,18 @@ jobs:
7176
matrix:
7277
platform: ["${{ inputs.OS_VERS_MIN }}", "${{ inputs.OS_VERS_MAX }}"]
7378
rust: ["${{ inputs.TOOLCHAIN_MIN }}", "${{ inputs.TOOLCHAIN_MAX }}", "nightly"]
74-
runs-on: ubuntu-${{ matrix.platform }}
79+
architecture: [amd64, arm64]
80+
runs-on: ubuntu-${{ matrix.architecture == 'arm64' && format('{0}-arm', matrix.platform) || matrix.platform }}
7581
steps:
7682
- uses: actions/checkout@v4
7783
- uses: actions-rust-lang/setup-rust-toolchain@v1
7884
with:
7985
toolchain: ${{ matrix.rust }}
8086
cache: false
81-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
87+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
8288
with:
83-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
89+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
90+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
8491
- run: |
8592
cp -vr examples/data ~/my-fapi-config
8693
make docker.swtpm DETACH=1
@@ -96,21 +103,22 @@ jobs:
96103
matrix:
97104
platform: ["${{ inputs.OS_VERS_MIN }}", "${{ inputs.OS_VERS_MAX }}"]
98105
rust: ["${{ inputs.TOOLCHAIN_MIN }}", "${{ inputs.TOOLCHAIN_MAX }}", "nightly"]
106+
architecture: [amd64, arm64]
99107
profile: [RSA2048SHA256, ECCP256SHA256]
100-
runs-on: ubuntu-${{ matrix.platform }}
108+
runs-on: ubuntu-${{ matrix.architecture == 'arm64' && format('{0}-arm', matrix.platform) || matrix.platform }}
101109
steps:
102110
- uses: actions/checkout@v4
103111
- uses: actions-rust-lang/setup-rust-toolchain@v1
104112
with:
105113
toolchain: ${{ matrix.rust }}
106114
cache: false
107-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
115+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
108116
with:
109-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
117+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
118+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
110119
- run: |
111120
make docker.swtpm DETACH=1
112121
make tests FAPI_RS_TEST_PROF=${{ matrix.profile }}
113-
make docker.down
114122
115123
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116124
# Docker-based tests
@@ -143,9 +151,10 @@ jobs:
143151
cache: false
144152
components: llvm-tools-preview
145153
- uses: taiki-e/install-action@cargo-llvm-cov
146-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
154+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
147155
with:
148-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
156+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
157+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
149158
- run: |
150159
make docker.swtpm DETACH=1
151160
make codecov RUST_LOG=info TSS2_LOG=all+none
@@ -170,16 +179,18 @@ jobs:
170179
matrix:
171180
platform: ["${{ inputs.OS_VERS_MIN }}", "${{ inputs.OS_VERS_MAX }}"]
172181
rust: ["${{ inputs.TOOLCHAIN_MIN }}", "${{ inputs.TOOLCHAIN_MAX }}", "nightly"]
173-
runs-on: ubuntu-${{ matrix.platform }}
182+
architecture: [amd64, arm64]
183+
runs-on: ubuntu-${{ matrix.architecture == 'arm64' && format('{0}-arm', matrix.platform) || matrix.platform }}
174184
steps:
175185
- uses: actions/checkout@v4
176186
- uses: actions-rust-lang/setup-rust-toolchain@v1
177187
with:
178188
toolchain: ${{ matrix.rust }}
179189
cache: false
180-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
190+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
181191
with:
182-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
192+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
193+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
183194
- run: make build
184195
- run: cp -vf README.md LICENSE target/release/
185196
- run: |
@@ -188,7 +199,7 @@ jobs:
188199
"$(pkg-config --print-provides tss2-fapi)" > target/release/BUILD_INFO
189200
- uses: actions/upload-artifact@v4
190201
with:
191-
name: dist.binary.ubuntu-${{ matrix.platform }}-rust-${{ matrix.rust }}
202+
name: dist.ubuntu-${{ matrix.platform }}-${{ matrix.architecture }}.rust-${{ matrix.rust }}
192203
path: |
193204
target/release/libtss2_fapi_rs.rlib
194205
target/release/README.md
@@ -208,9 +219,10 @@ jobs:
208219
with:
209220
toolchain: ${{ inputs.TOOLCHAIN_MAX }}
210221
cache: false
211-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
222+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
212223
with:
213-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
224+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
225+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
214226
- run: make docs
215227
- run: |
216228
cp -f docs/html/redir.html target/doc/index.html
@@ -232,9 +244,10 @@ jobs:
232244
with:
233245
toolchain: ${{ inputs.TOOLCHAIN_MAX }}
234246
cache: false
235-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
247+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
236248
with:
237-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
249+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
250+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
238251
- run: make package
239252
- uses: actions/upload-artifact@v4
240253
with:
@@ -277,7 +290,7 @@ jobs:
277290
path: artifacts
278291
- working-directory: artifacts
279292
run: |
280-
for variant in dist.binary.*; do pushd -- ${variant}; \
293+
for variant in dist.*; do pushd -- ${variant}; \
281294
tar -czvf ../tss2-fapi-rs-${{ github.ref_name }}-${variant:12}.tar.gz *; \
282295
popd; done; mv -vf dist.package/*.crate ./; rm -r */
283296
- uses: Roang-zero1/github-upload-release-artifacts-action@v2
@@ -300,9 +313,10 @@ jobs:
300313
with:
301314
toolchain: ${{ inputs.TOOLCHAIN_MAX }}
302315
cache: false
303-
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
316+
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
304317
with:
305-
packages: libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
318+
packages: pkgconf libtss2-dev uuid-dev libjson-c-dev libcurl4-openssl-dev
319+
version: v2-${{ matrix.architecture }}-${{ matrix.platform }}-${{ github.run_id }}
306320
- run: make publish
307321
env:
308322
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

77
## [0.12.0] - 2026-01-22
88

9+
### Added
10+
11+
- GitHub Actions: Run the examples and integration tests also on the `aarch64` platform.
12+
913
### Changed
1014

1115
- Improved `FapiContext::create_seal()` to accept either a non-empty `&[u8]` slice or a `NonZeroUsize` value.

build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* All rights reserved.
55
**********************************************************************************************/
66

7+
#[cfg(not(target_family = "unix"))]
8+
compile_error!("Sorry, this project currently only supports the Unix platform.");
9+
710
use pkg_config::{Config, Error};
811
use regex::Regex;
912
use std::{

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@
426426
427427
#![doc(html_no_source)]
428428

429+
#[cfg(not(target_family = "unix"))]
430+
compile_error!("Sorry, this project currently only supports the Unix platform.");
431+
429432
mod algorithm_id;
430433
mod callback;
431434
mod context;

0 commit comments

Comments
 (0)