Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ test-threads = 1

[profile.ci-provider-integration.junit]
path = "junit.xml"

# profile for running the MBOR types smoke tests against the emu backend
# (in-process firmware).
[profile.ci-mbor-smoke.junit]
path = "junit.xml"
83 changes: 83 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,50 @@ jobs:
echo "One or more tests failed."
exit 1

test_ubuntu_smoke:

runs-on: ubuntu-24.04

defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v6
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libbsd-dev

- name: Restore Cargo cache
id: cargo-cache
uses: actions/cache/restore@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ env.CACHE_KEY_ID }}
- name: Setup
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo xtask setup
- name: Run MBOR types smoke tests against emu backend
id: test-mbor-smoke
run: cargo xtask precheck --nextest --package azihsm_ddi_mbor_types --features emu --test azihsm_ddi_tests --filter smoke
continue-on-error: true
Comment on lines +121 to +124
- name: Generate nextest report
id: nextest-report
run: cargo xtask precheck --nextest-report
- name: Code Coverage Summary Report
if: ${{ steps.test-mbor-smoke.outcome == 'success' }}
run: cargo xtask precheck --coverage-report
Comment on lines +128 to +130
- name: Fail if any tests failed
if: ${{ steps.test-mbor-smoke.outcome == 'failure' }}
run: |
echo "One or more tests failed."
exit 1

build_windows:

runs-on: windows-2025-vs2026
Expand Down Expand Up @@ -145,3 +189,42 @@ jobs:
run: |
echo "One or more tests failed."
exit 1

test_windows_smoke:

runs-on: windows-2025-vs2026

defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v6
- name: Restore Cargo cache
id: cargo-cache
uses: actions/cache/restore@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ env.CACHE_KEY_ID }}
- name: Setup
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo xtask setup
- name: Run MBOR types smoke tests against emu backend
id: test-mbor-smoke
run: cargo xtask precheck --nextest --package azihsm_ddi_mbor_types --features emu --test azihsm_ddi_tests --filter smoke
continue-on-error: true
Comment on lines +216 to +219
- name: Generate nextest report
id: nextest-report
run: cargo xtask precheck --nextest-report
- name: Code Coverage Summary Report
if: ${{ steps.test-mbor-smoke.outcome == 'success' }}
run: cargo xtask precheck --coverage-report
Comment on lines +223 to +225
- name: Fail if any tests failed
if: ${{ steps.test-mbor-smoke.outcome == 'failure' }}
run: |
echo "One or more tests failed."
exit 1
16 changes: 16 additions & 0 deletions xtask/src/nextest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ pub struct Nextest {
/// Crates to exclude from nextest (e.g. crates with heavyweight build scripts)
#[clap(long)]
pub exclude: Vec<String>,

/// Test only the specified test target
#[clap(long)]
pub test: Option<String>,

/// Test name filters
#[clap(long)]
pub filter: Vec<String>,
Comment on lines +44 to +50
}

impl Xtask for Nextest {
Expand Down Expand Up @@ -97,6 +105,14 @@ impl Xtask for Nextest {
command_args.push(val);
}
}
let test_val = self.test.clone().unwrap_or_default();
if self.test.is_some() {
command_args.push("--test");
command_args.push(&test_val);
}
if !self.filter.is_empty() {
command_args.extend(self.filter.iter().map(|s| s.as_str()));
}

cmd!(
sh,
Expand Down
29 changes: 29 additions & 0 deletions xtask/src/precheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

//! Xtask to run various repo-specific checks

use std::vec;

Comment on lines +9 to +10
use clap::Parser;

use crate::audit::Audit;
Expand Down Expand Up @@ -180,6 +182,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile.clone().or(Some("ci-mock".to_string())),
exclude: self.exclude.clone(),
test: None,
filter: vec![],
}
.run(ctx.clone())?;

Expand All @@ -193,6 +197,23 @@ impl Xtask for Precheck {
filterset: Some("test(resiliency::fault_injection::)".to_string()),
profile: self.profile.clone().or(Some("ci-mock-res".to_string())),
exclude: self.exclude.clone(),
test: None,
filter: vec![],
}
.run(ctx.clone())?;
}

// Run MBOR types smoke tests against emu backend
if !self.exclude.iter().any(|e| e == "azihsm_ddi_mbor_types") {
Nextest {
features: Some("emu".to_string()),
package: Some("azihsm_ddi_mbor_types".to_string()),
no_default_features: false,
filterset: None,
profile: self.profile.clone().or(Some("ci-mbor-smoke".to_string())),
exclude: self.exclude.clone(),
test: None,
filter: vec![],
Comment on lines +215 to +216
}
.run(ctx.clone())?;
}
Expand All @@ -207,6 +228,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile.clone().or(Some("ci-mock-table-4".to_string())),
exclude: self.exclude.clone(),
test: None,
filter: vec![],
}
.run(ctx.clone())?;

Expand All @@ -221,6 +244,8 @@ impl Xtask for Precheck {
.clone()
.or(Some("ci-mock-table-64".to_string())),
exclude: self.exclude.clone(),
test: None,
filter: vec![],
}
.run(ctx.clone())?;

Expand All @@ -233,6 +258,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile.clone().or(Some("ci-tbor-emu".to_string())),
exclude: self.exclude.clone(),
test: None,
filter: vec![],
}
.run(ctx.clone())?;
}
Expand All @@ -244,6 +271,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile,
exclude: self.exclude,
test: None,
filter: vec![],
}
.run(ctx.clone())?;
}
Expand Down
Loading