Skip to content

Commit

Permalink
ci: Run clippy and test for every feature individually
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpinder committed Sep 29, 2024
1 parent f0679fd commit 37a69df
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
18 changes: 15 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,27 @@ lint:
DO rust+CARGO --args="clippy"
DO rust+CARGO --args="clippy --all-features"
DO rust+CARGO --args="clippy --no-default-features"
DO rust+CARGO --args="clippy --no-default-features --features stages"
DO rust+CARGO --args="clippy --no-default-features --features copy"
DO rust+CARGO --args="clippy --no-default-features --features multi-recipe"
DO rust+CARGO --args="clippy --no-default-features --features iso"
DO rust+CARGO --args="clippy --no-default-features --features switch"
DO rust+CARGO --args="clippy --no-default-features --features sigstore"

test:
FROM +common
COPY --dir test-files/ integration-tests/ /app
COPY +cosign/cosign /usr/bin/cosign

DO rust+CARGO --args="test --workspace -- --show-output"
DO rust+CARGO --args="test --workspace --all-features -- --show-output"
DO rust+CARGO --args="test --workspace --no-default-features -- --show-output"
DO rust+CARGO --args="test --workspace"
DO rust+CARGO --args="test --workspace --all-features"
DO rust+CARGO --args="test --workspace --no-default-features"
DO rust+CARGO --args="test --workspace --no-default-features --features stages"
DO rust+CARGO --args="test --workspace --no-default-features --features copy"
DO rust+CARGO --args="test --workspace --no-default-features --features multi-recipe"
DO rust+CARGO --args="test --workspace --no-default-features --features iso"
DO rust+CARGO --args="test --workspace --no-default-features --features switch"
DO rust+CARGO --args="test --workspace --no-default-features --features sigstore"

install:
FROM +common
Expand Down
2 changes: 1 addition & 1 deletion src/commands/generate_iso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl BlueBuildCommand for GenerateIsoCommand {
#[cfg(not(feature = "multi-recipe"))]
let mut build_command = {
BuildCommand::builder()
.recipe(recipe.to_path_buf())
.recipe(recipe.clone())
.archive(image_out_dir.path())
.build()
};
Expand Down
8 changes: 8 additions & 0 deletions src/commands/switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,20 @@ impl BlueBuildCommand for SwitchCommand {
let tempdir = TempDir::new("oci-archive").into_diagnostic()?;
trace!("{tempdir:?}");

#[cfg(feature = "multi-recipe")]
BuildCommand::builder()
.recipe([self.recipe.clone()])
.archive(tempdir.path())
.force(self.force)
.build()
.try_run()?;
#[cfg(not(feature = "multi-recipe"))]
BuildCommand::builder()
.recipe(self.recipe.clone())
.archive(tempdir.path())
.force(self.force)
.build()
.try_run()?;

let recipe = Recipe::parse(&self.recipe)?;
let image_file_name = format!(
Expand Down

0 comments on commit 37a69df

Please sign in to comment.