diff --git a/.woodpecker/audit.yml b/.woodpecker/audit.yml index 97085de..a6f3c38 100644 --- a/.woodpecker/audit.yml +++ b/.woodpecker/audit.yml @@ -9,7 +9,11 @@ when: steps: - name: audit - image: rust:1.91 + image: nixos/nix:latest + environment: + NIX_CONFIG: "extra-experimental-features = nix-command flakes" + secrets: [cachix_auth_token] commands: - - cargo install cargo-audit --locked - - cargo audit + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo audit diff --git a/.woodpecker/doc.yml b/.woodpecker/doc.yml index 91d920f..9b43148 100644 --- a/.woodpecker/doc.yml +++ b/.woodpecker/doc.yml @@ -1,10 +1,19 @@ when: - event: [push, pull_request, manual] +variables: + - &nix_image "nixos/nix:latest" + - &nix_env + NIX_CONFIG: "extra-experimental-features = nix-command flakes" + steps: - name: doc - image: rust:1.90 + image: *nix_image environment: + <<: *nix_env RUSTDOCFLAGS: "-D warnings" + secrets: [cachix_auth_token] commands: - - cargo doc --workspace --no-deps + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo doc --workspace --no-deps diff --git a/.woodpecker/ffi.yml b/.woodpecker/ffi.yml index 6774155..94a57ad 100644 --- a/.woodpecker/ffi.yml +++ b/.woodpecker/ffi.yml @@ -10,7 +10,13 @@ when: steps: - name: ffi-e2e image: nixos/nix:latest + environment: + NIX_CONFIG: "extra-experimental-features = nix-command flakes" + secrets: [cachix_auth_token] commands: - - nix --extra-experimental-features "nix-command flakes" develop .#ffi --command bash -c 'cargo test --workspace --test ffi_e2e -- --include-ignored --nocapture' - - nix --extra-experimental-features "nix-command flakes" develop .#ffi --command cargo test --manifest-path future_form_ffi/examples/key_value_store/kv_store/Cargo.toml - - nix --extra-experimental-features "nix-command flakes" develop .#ffi --command cargo test --manifest-path future_form_ffi/examples/counter_effects/counter_effects/Cargo.toml + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop .#ffi --command bash -c 'cargo test --workspace --test ffi_e2e -- --include-ignored --nocapture' + - nix develop .#ffi --command cargo test --manifest-path future_form_ffi/examples/key_value_store/kv_store/Cargo.toml + - nix develop .#ffi --command cargo test --manifest-path future_form_ffi/examples/counter_effects/counter_effects/Cargo.toml + - nix develop .#ffi --command bash -c 'cachix push expede $(nix path-info --derivation .#devShells.x86_64-linux.ffi) 2>/dev/null || true' diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index 506d8e9..51400ab 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -1,29 +1,30 @@ when: - event: [push, pull_request, manual] -steps: - - name: build - image: rust:1.90 - commands: - - cargo build --workspace --verbose - depends_on: [] - - - name: build-all-features - image: rust:1.90 - commands: - - cargo build --workspace --verbose --all-features - depends_on: [] +variables: + - &nix_image "nixos/nix:latest" + - &nix_env + NIX_CONFIG: "extra-experimental-features = nix-command flakes" +steps: - name: fmt - image: rustlang/rust:nightly + image: *nix_image + environment: + <<: *nix_env + secrets: [cachix_auth_token] commands: - - rustup component add rustfmt - - cargo fmt --all -- --check + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo fmt --all -- --check depends_on: [] - name: clippy - image: rust:1.90 + image: *nix_image + environment: + <<: *nix_env + secrets: [cachix_auth_token] commands: - - rustup component add clippy - - cargo clippy --workspace --all-targets --all-features -- -D warnings - depends_on: [build] + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo clippy --workspace --all-targets --all-features -- -D warnings + depends_on: [] diff --git a/.woodpecker/spellcheck.yml b/.woodpecker/spellcheck.yml index b14a548..af9a6b0 100644 --- a/.woodpecker/spellcheck.yml +++ b/.woodpecker/spellcheck.yml @@ -10,7 +10,11 @@ when: steps: - name: typos - image: rust:1.91 + image: nixos/nix:latest + environment: + NIX_CONFIG: "extra-experimental-features = nix-command flakes" + secrets: [cachix_auth_token] commands: - - cargo install typos-cli --locked - - typos + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command typos diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index 44fdbda..003cec6 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -1,36 +1,55 @@ when: - event: [push, pull_request, manual] +variables: + - &nix_image "nixos/nix:latest" + - &nix_env + NIX_CONFIG: "extra-experimental-features = nix-command flakes" + steps: - name: test - image: rust:1.90 + image: *nix_image + environment: + <<: *nix_env + secrets: [cachix_auth_token] commands: - - cargo test --workspace - depends_on: [] - - - name: test-all-features - image: rust:1.90 - commands: - - cargo test --workspace --all-features - depends_on: [] + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo test --workspace + - nix develop --command cargo test --workspace --all-features + - nix develop --command bash -c 'cachix push expede $(nix path-info --derivation .#devShells.x86_64-linux.default) 2>/dev/null || true' - name: no-std-check - image: rust:1.90 + image: *nix_image + environment: + <<: *nix_env + secrets: [cachix_auth_token] commands: - - cargo check --package future_form --no-default-features + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo check --package future_form --no-default-features depends_on: [] - name: example-tests - image: rust:1.90 + image: *nix_image + environment: + <<: *nix_env + secrets: [cachix_auth_token] commands: - - cargo test --manifest-path future_form_ffi/examples/key_value_store/kv_store/Cargo.toml - - cargo test --manifest-path future_form_ffi/examples/counter_effects/counter_effects/Cargo.toml + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo test --manifest-path future_form_ffi/examples/key_value_store/kv_store/Cargo.toml + - nix develop --command cargo test --manifest-path future_form_ffi/examples/counter_effects/counter_effects/Cargo.toml depends_on: [] - name: wasm32-check - image: rust:1.90 + image: *nix_image + environment: + <<: *nix_env + secrets: [cachix_auth_token] commands: - - rustup target add wasm32-unknown-unknown - - cargo check --package future_form --target wasm32-unknown-unknown - - cargo check --package future_form_ffi --target wasm32-unknown-unknown + - nix profile install nixpkgs#cachix + - cachix use expede + - nix develop --command cargo check --package future_form --target wasm32-unknown-unknown + - nix develop --command cargo check --package future_form_ffi --target wasm32-unknown-unknown depends_on: [] diff --git a/flake.nix b/flake.nix index 4cffc85..e3420bc 100644 --- a/flake.nix +++ b/flake.nix @@ -62,12 +62,13 @@ ]; cargo-installs = with pkgs; [ + cargo-component cargo-deny cargo-expand cargo-outdated cargo-sort cargo-udeps - cargo-component + typos ]; # Command utils