From 1a2f0bef7253ff6996c63ca3ad68fa9c01b0da1a Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 7 Apr 2025 13:08:49 +0200 Subject: [PATCH] ci: add caching via volumes --- .woodpecker/cargo_check.yaml | 7 +++++-- .woodpecker/cargo_clippy.yaml | 5 ++++- .woodpecker/cargo_test.yaml | 5 ++++- .woodpecker/check_fmt.yaml | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.woodpecker/cargo_check.yaml b/.woodpecker/cargo_check.yaml index 557ee6c..bf57e90 100644 --- a/.woodpecker/cargo_check.yaml +++ b/.woodpecker/cargo_check.yaml @@ -3,7 +3,10 @@ when: steps: - name: "Run cargo check" - image: docker.nix-community.org/nixpkgs/nix-flakes + image: nixos/nix commands: - - nix shell github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc + - echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf + - nix shell --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc - cargo check --workspace --all-targets + volumes: + - /nix:/mnt/nix:ro diff --git a/.woodpecker/cargo_clippy.yaml b/.woodpecker/cargo_clippy.yaml index dd4c38e..c1bba3c 100644 --- a/.woodpecker/cargo_clippy.yaml +++ b/.woodpecker/cargo_clippy.yaml @@ -5,5 +5,8 @@ steps: - name: "Run cargo clippy" image: docker.nix-community.org/nixpkgs/nix-flakes commands: - - nix shell github:nixos/nixpkgs/nixos-unstable#clippy github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc + - echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf + - nix shell --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt github:nixos/nixpkgs/nixos-unstable#clippy github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc - cargo clippy + volumes: + - /nix:/mnt/nix:ro diff --git a/.woodpecker/cargo_test.yaml b/.woodpecker/cargo_test.yaml index 6c5d3fb..d4cf5ff 100644 --- a/.woodpecker/cargo_test.yaml +++ b/.woodpecker/cargo_test.yaml @@ -5,5 +5,8 @@ steps: - name: "Run cargo test" image: docker.nix-community.org/nixpkgs/nix-flakes commands: - - nix shell github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc + - echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf + - nix shell --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc - cargo test --workspace --all-targets + volumes: + - /nix:/mnt/nix:ro diff --git a/.woodpecker/check_fmt.yaml b/.woodpecker/check_fmt.yaml index 5e95d46..b575b8b 100644 --- a/.woodpecker/check_fmt.yaml +++ b/.woodpecker/check_fmt.yaml @@ -5,4 +5,7 @@ steps: - name: "Run treefmt" image: docker.nix-community.org/nixpkgs/nix-flakes commands: - - nix fmt -- --fail-on-change + - echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf + - nix fmt --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt -- --fail-on-change + volumes: + - /nix:/mnt/nix:ro