Skip to content

Add CI workflow and flake checks#2

Open
ProjectInitiative wants to merge 7 commits intomainfrom
add-ci-workflow-818934876918795744
Open

Add CI workflow and flake checks#2
ProjectInitiative wants to merge 7 commits intomainfrom
add-ci-workflow-818934876918795744

Conversation

@ProjectInitiative
Copy link
Owner

This PR adds a CI workflow to the project.
It refactors crane.nix to expose the build configuration, which is then used in flake.nix to define checks for:

  • The package build (including tests)
  • Clippy linting
  • Rust formatting

The CI workflow runs nix flake check to execute these checks. It also includes a necessary AppArmor configuration step for Nix sandboxing on Ubuntu runners.


PR created automatically by Jules for task 818934876918795744 started by @ProjectInitiative

Add a GitHub Actions workflow to run `nix flake check` on push and pull request to main.
Refactor `crane.nix` to return build arguments instead of a derivation, allowing `flake.nix` to define separate checks for the package build, clippy, and rustfmt.
Include an AppArmor fix in the CI workflow to support Bubblewrap on Ubuntu runners.

Co-authored-by: ProjectInitiative <6314611+ProjectInitiative@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 3 commits February 24, 2026 07:21
Update `flake.nix` to use `craneLib.buildDepsOnly` to build `cargoArtifacts` first.
Pass `cargoArtifacts` to `craneLib.buildPackage` (for the main build) and `craneLib.cargoClippy` (for the clippy check).
This fixes the CI error where `cargoClippy` was missing the required `cargoArtifacts` argument.

Co-authored-by: ProjectInitiative <6314611+ProjectInitiative@users.noreply.github.com>
Run `cargo fmt` to fix code style issues in `src/s3_uploader.rs`.
This is required to pass the `cargo fmt` check in CI.

Co-authored-by: ProjectInitiative <6314611+ProjectInitiative@users.noreply.github.com>
Fix `clippy::manual_strip` warning in `src/s3_uploader.rs`.
This is required to pass the `cargo clippy --deny warnings` check in CI.

Co-authored-by: ProjectInitiative <6314611+ProjectInitiative@users.noreply.github.com>
@ProjectInitiative
Copy link
Owner Author

please fix the build error: error: builder for '/nix/store/ky46d7rndy225d49zr6a2n7hm54067a9-loft-fmt-0.2.0.drv' failed with exit code 1;
last 10 log lines:
> Diff in /build/source/src/s3_uploader.rs:159:
> for object in contents {
> if let Some(key) = object.key {
> if key.ends_with(".narinfo") {
> - let processed_key = if let Some(stripped) = key.strip_prefix("sha256:") {
> + let processed_key = if let Some(stripped) = key.strip_prefix("sha256:")
> + {
> stripped.to_string()
> } else {
> key
For full logs, run 'nix log /nix/store/ky46d7rndy225d49zr6a2n7hm54067a9-loft-fmt-0.2.0.drv'.
error: build of '/nix/store/jal8dlsiqysxijxv4rmjhwllb5df7dyl-loft-clippy-0.2.0.drv', '/nix/store/ky46d7rndy225d49zr6a2n7hm54067a9-loft-fmt-0.2.0.drv', '/nix/store/yh6nd3673cm8gy35qm2fqi6pasmrkypi-loft-0.2.0.drv' failed

@google-labs-jules
Copy link
Contributor

please fix the build error: error: builder for '/nix/store/ky46d7rndy225d49zr6a2n7hm54067a9-loft-fmt-0.2.0.drv' failed with exit code 1;
last 10 log lines:
> Diff in /build/source/src/s3_uploader.rs:159:
> for object in contents {
> if let Some(key) = object.key {
> if key.ends_with(".narinfo") {
> - let processed_key = if let Some(stripped) = key.strip_prefix("sha256:") {
> + let processed_key = if let Some(stripped) = key.strip_prefix("sha256:")
> + {
> stripped.to_string()
> } else {
> key
For full logs, run 'nix log /nix/store/ky46d7rndy225d49zr6a2n7hm54067a9-loft-fmt-0.2.0.drv'.
error: build of '/nix/store/jal8dlsiqysxijxv4rmjhwllb5df7dyl-loft-clippy-0.2.0.drv', '/nix/store/ky46d7rndy225d49zr6a2n7hm54067a9-loft-fmt-0.2.0.drv', '/nix/store/yh6nd3673cm8gy35qm2fqi6pasmrkypi-loft-0.2.0.drv' failed

I've fixed the formatting issue in src/s3_uploader.rs to match the expected style.

Reformat the `if let` expression in `src/s3_uploader.rs` to match the expected style required by `cargo fmt`.
This resolves the build failure in the CI formatting check.

Co-authored-by: ProjectInitiative <6314611+ProjectInitiative@users.noreply.github.com>
@ProjectInitiative
Copy link
Owner Author

building '/nix/store/z1l4fyy86545yj8ky5vgcfjy90gc9b06-loft-0.2.0.drv'...
building '/nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv'...
error: builder for '/nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv' failed with exit code 101;
last 10 log lines:
> |
> 480 | let _ = sleep(Duration::from_secs(5));
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |
> = help: consider awaiting the future or dropping explicitly with std::mem::drop
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
>
> error: could not compile loft (lib test) due to 53 previous errors
> warning: build failed, waiting for other jobs to finish...
> error: could not compile loft (lib) due to 53 previous errors
For full logs, run 'nix log /nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv'.
error: build of '/nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv', '/nix/store/z1l4fyy86545yj8ky5vgcfjy90gc9b06-loft-0.2.0.drv' failed

@google-labs-jules
Copy link
Contributor

building '/nix/store/z1l4fyy86545yj8ky5vgcfjy90gc9b06-loft-0.2.0.drv'...
building '/nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv'...
error: builder for '/nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv' failed with exit code 101;
last 10 log lines:
> |
> 480 | let _ = sleep(Duration::from_secs(5));
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |
> = help: consider awaiting the future or dropping explicitly with std::mem::drop
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
>
> error: could not compile loft (lib test) due to 53 previous errors
> warning: build failed, waiting for other jobs to finish...
> error: could not compile loft (lib) due to 53 previous errors
For full logs, run 'nix log /nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv'.
error: build of '/nix/store/cb5cp500ry7s5yrgsb2hrc0j80kykvcv-loft-clippy-0.2.0.drv', '/nix/store/z1l4fyy86545yj8ky5vgcfjy90gc9b06-loft-0.2.0.drv' failed

I've fixed the clippy::let_underscore_future warnings in src/nix_utils.rs by correctly awaiting the tokio::time::sleep calls.

google-labs-jules bot and others added 2 commits February 28, 2026 01:58
Resolve `clippy::let_underscore_future` warnings in `src/nix_utils.rs` by correctly awaiting the `sleep` calls instead of ignoring the future.
This is required to pass the CI clippy check.

Co-authored-by: ProjectInitiative <6314611+ProjectInitiative@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant