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
80 changes: 0 additions & 80 deletions .github/workflows/cocl_basic_ci.yaml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# SPDX-FileCopyrightText: Yalan Zhang <yalzhang@redhat.com>
# SPDX-FileCopyrightText: Timothée Ravier <tim@siosm.fr>
#
# SPDX-License-Identifier: CC0-1.0

# Inspired by https://github.com/coreos/repo-templates

name: "Rust"
on:
pull_request:
branches:
- "main"
permissions:
contents: "read"

# Don't waste job slots on superseded code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
# Pinned toolchain for linting
ACTIONS_LINTS_TOOLCHAIN: 1.85.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would need to be

Suggested change
ACTIONS_LINTS_TOOLCHAIN: 1.85.0
ACTIONS_LINTS_TOOLCHAIN: 1.88.0

or we relax the MSRV back down to 1.85, #14 removed the constructs that required 1.88

Copy link
Member Author

@travier travier Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start with 1.85.0 as that's what we use in CoreOS as that's what's in some version of RHEL. We can bump it back later.


jobs:
tests-stable:
name: "Tests, stable toolchain"
runs-on: "ubuntu-24.04"
container: "ghcr.io/confidential-clusters/buildroot:latest"
steps:
- name: "Check out repository"
uses: actions/checkout@v5
- name: "Install toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: "Cache build artifacts"
uses: Swatinem/rust-cache@v2
- name: "cargo build"
run: cargo build --all-targets
- name: "cargo test"
run: cargo test --all-targets
tests-release-stable:
name: "Tests (release), stable toolchain"
runs-on: "ubuntu-24.04"
container: "ghcr.io/confidential-clusters/buildroot:latest"
steps:
- name: "Check out repository"
uses: actions/checkout@v5
- name: "Install toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: "Cache build artifacts"
uses: Swatinem/rust-cache@v2
- name: "cargo build (release)"
run: cargo build --all-targets --release
- name: "cargo test (release)"
run: cargo test --all-targets --release
tests-release-msrv:
name: "Tests (release), minimum supported toolchain"
runs-on: "ubuntu-24.04"
container: "ghcr.io/confidential-clusters/buildroot:latest"
steps:
- name: "Check out repository"
uses: actions/checkout@v5
- name: "Detect crate MSRV"
run: |
msrv=$(cargo metadata --format-version 1 --no-deps | \
jq -r '.packages[0].rust_version')
echo "Crate MSRV: $msrv"
echo "MSRV=$msrv" >> $GITHUB_ENV
- name: "Install toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.MSRV }}
- name: "Cache build artifacts"
uses: Swatinem/rust-cache@v2
- name: "cargo build (release)"
run: cargo build --all-targets --release
- name: "cargo test (release)"
run: cargo test --all-targets --release
linting:
name: "Lints, pinned toolchain"
runs-on: "ubuntu-24.04"
container: "ghcr.io/confidential-clusters/buildroot:latest"
steps:
- name: "Check out repository"
uses: actions/checkout@v5
- name: "Install toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.ACTIONS_LINTS_TOOLCHAIN }}
components: rustfmt, clippy
- name: "Cache build artifacts"
uses: Swatinem/rust-cache@v2
- name: "cargo fmt (check)"
run: cargo fmt -- --check -l
- name: "cargo clippy (warnings)"
run: cargo clippy --all-targets -- -D warnings
tests-other-channels:
name: "Tests, unstable toolchain"
runs-on: "ubuntu-24.04"
container: "ghcr.io/confidential-clusters/buildroot:latest"
continue-on-error: true
strategy:
matrix:
channel: [beta, nightly]
steps:
- name: "Check out repository"
uses: actions/checkout@v5
- name: "Install toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.channel }}
- name: "Cache build artifacts"
uses: Swatinem/rust-cache@v2
- name: "cargo build"
run: cargo build --all-targets
- name: "cargo test"
run: cargo test --all-targets
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "3"

[workspace.package]
edition = "2024"
rust-version = "1.88"
rust-version = "1.85"

[workspace.dependencies]
anyhow = "1.0.99"
Expand Down
1 change: 1 addition & 0 deletions compute-pcrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "compute-pcrs"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
description = "A cocl-operator optimized compute-pcrs interface"

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions crds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "crds"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true

[dependencies]
k8s-openapi.workspace = true
Expand Down
1 change: 1 addition & 0 deletions manifest-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "manifest-gen"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true

[dependencies]
anyhow.workspace = true
Expand Down
1 change: 1 addition & 0 deletions operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "operator"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true

[dependencies]
anyhow.workspace = true
Expand Down
1 change: 1 addition & 0 deletions rv-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "rv-store"
version = "0.1.0"
description = "Reference values store definition for operator and compute-pcrs"
edition.workspace = true
rust-version.workspace = true

[dependencies]
chrono.workspace = true
Expand Down
Loading