Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Formatting, lints, and tests on both platforms Keystone supports.
# Formatting, lints, and tests on the platforms Keystone supports.
#
# Only first-party actions are used, and the toolchain comes from the `rustup`
# already on the runner image rather than a third-party setup action. Keystone's
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
# failure in one says nothing about the other.
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
os: [macos-latest, windows-latest, ubuntu-24.04]
steps:
- uses: actions/checkout@v7

Expand All @@ -52,6 +52,12 @@ jobs:
rustc --version
echo "version=$(rustc --version | tr ' ()' '-')" >> "$GITHUB_OUTPUT"

- name: Install Linux TPM dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libtss2-dev

# The compiler version is part of the key, not just the lockfile: a cached
# `target` directory built by a different rustc is not reusable, and a
# restore-keys fallback onto one produces a confusing full rebuild at best.
Expand All @@ -65,15 +71,15 @@ jobs:
key: ${{ runner.os }}-cargo-${{ steps.toolchain.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-${{ steps.toolchain.outputs.version }}-

# Formatting is platform-independent, so it runs once rather than twice.
# Formatting is platform-independent, so it runs once.
- name: cargo fmt
if: runner.os == 'macOS'
run: cargo fmt --all --check

- name: cargo clippy
run: cargo clippy --workspace --all-targets --locked -- -D warnings

# The hardware tests early-return when the platform has no key store, and
# The hardware tests are opt-in on Linux or skip without a key store, and
# GitHub's runners have neither a Secure Enclave nor a TPM. That is the
# design's fail-closed behaviour observed from the outside: everything
# that does not need hardware still runs, and nothing silently falls back
Expand All @@ -83,8 +89,11 @@ jobs:
run: cargo test --workspace --locked

msrv:
name: msrv (1.88)
runs-on: macos-latest
name: msrv (1.88, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-24.04]
steps:
- uses: actions/checkout@v7

Expand All @@ -96,4 +105,10 @@ jobs:
rustup toolchain install 1.88 --profile minimal
rustup default 1.88

- name: Install Linux TPM dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libtss2-dev

- run: cargo check --workspace --all-targets --locked
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
# nothing else. That way the release path is exercised routinely rather than only
# at the moment it matters.
#
# The build matrix follows the design document's Platform Support section
# exactly: Apple Silicon macOS and x86-64 Windows. Intel macOS is listed there as
# "may be supported later after integration testing", so there is deliberately no
# `x86_64-apple-darwin` entry — shipping a binary for a configuration the project
# has not tested would make an untested claim.
# Ship Apple Silicon macOS, x86-64 Windows, and x86-64 Linux builds. Linux
# links against the TPM2 software stack from the Ubuntu 24.04 runner.
name: Release

on:
Expand Down Expand Up @@ -59,6 +56,11 @@ jobs:
# does not have — Windows decides by extension. A container would
# add an extraction step and protect nothing.
archive: none
- name: linux-x86_64
os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
binary: keystone
archive: tar.gz
steps:
- uses: actions/checkout@v7

Expand All @@ -68,6 +70,12 @@ jobs:
rustup default stable
rustc --version

- name: Install Linux TPM dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libtss2-dev

# `--locked` so a release binary is built from the dependency versions in
# the committed lockfile and not from whatever resolves that day.
- name: Build
Expand Down Expand Up @@ -167,13 +175,13 @@ jobs:
run: |
# An empty glob would expand to a literal pattern and attach nothing,
# so the file list is checked before the release is created rather than
# discovered as a release with no binaries on it. Four files: an
# archive and a checksum for each of the two platforms.
# discovered as a release with no binaries on it. Six files: an
# archive and a checksum for each of the three platforms.
shopt -s nullglob
assets=(dist/*.tar.gz dist/*.exe dist/*.sha256)
printf '%s\n' "${assets[@]}"
if [ "${#assets[@]}" -ne 4 ]; then
echo "expected 4 assets, found ${#assets[@]}" >&2
if [ "${#assets[@]}" -ne 6 ]; then
echo "expected 6 assets, found ${#assets[@]}" >&2
exit 1
fi

Expand Down
Loading
Loading