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
42 changes: 23 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ jobs:
timeout-minutes: 10
permissions:
contents: read
defaults:
run:
shell: nix develop --command bash -eo pipefail {0}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
with:
toolchain: stable
components: clippy
rustflags: ""
- name: Set up Nix
uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0

- name: Run clippy
run: cargo clippy -- -D warnings
Expand All @@ -48,18 +47,17 @@ jobs:
timeout-minutes: 10
permissions:
contents: read
defaults:
run:
shell: nix develop --command bash -eo pipefail {0}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
with:
toolchain: stable
components: rustfmt
rustflags: ""
- name: Set up Nix
uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0

- name: Run rustfmt
run: cargo fmt --check
Expand All @@ -69,17 +67,17 @@ jobs:
timeout-minutes: 10
permissions:
contents: read
defaults:
run:
shell: nix develop --command bash -eo pipefail {0}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
with:
toolchain: stable
rustflags: ""
- name: Set up Nix
uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0

- name: Run tests
run: cargo test
Expand All @@ -89,17 +87,23 @@ jobs:
timeout-minutes: 10
permissions:
contents: read
defaults:
run:
shell: nix develop --command bash -eo pipefail {0}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Set up Nix
uses: furedea/reusable-workflows/.github/actions/nix-setup@2ae953294b9a805d0705657adc1d9d4f1bc1f646 # v1.3.0

- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@6c8f9facfa5047ec02d8485b6bf52b587b7777d1 # v2.0.18
run: cargo deny check

- name: Run cargo-machete
uses: bnjbvr/cargo-machete@ac30a525c0a8d163a92d727b3ff079ee3f6ecb08 # v0.9.2
run: cargo machete

gha-lint:
uses: furedea/reusable-workflows/.github/workflows/gha-lint.yml@ca7c5f2973a899e209bc60767f434aecbc186bc9 # v1.1.0
Expand Down
49 changes: 30 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,37 @@
outputs =
{ nixpkgs, nixpkgs-unstable, ... }:
let
system = "aarch64-darwin";
pkgs = import nixpkgs { inherit system; };
systems = [
"aarch64-darwin"
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
cargo
cargo-deny
cargo-machete
clippy
commitlint
deadnix
# lefthook before 2.1.6 runs hooks under a pty, which agent sandboxes deny.
nixpkgs-unstable.legacyPackages.${system}.lefthook
ls-lint
nixfmt
rustc
rustfmt
statix
];
};
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
packages = with pkgs; [
cargo
cargo-deny
cargo-machete
clippy
commitlint
deadnix
# lefthook before 2.1.6 runs hooks under a pty, which agent sandboxes deny.
nixpkgs-unstable.legacyPackages.${system}.lefthook
ls-lint
nixfmt
rustc
rustfmt
statix
];
};
}
);
};
}
Loading