From 05a98ff45cb129513938e9ad609cc4d9bee577df Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 2 Feb 2025 21:08:47 +0100 Subject: [PATCH] woodpecker ci: run steps in parallel --- .woodpecker/debug.yaml | 13 +++++++------ nix/compile.nix | 11 ++++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.woodpecker/debug.yaml b/.woodpecker/debug.yaml index b2e8b090..b6603bc3 100644 --- a/.woodpecker/debug.yaml +++ b/.woodpecker/debug.yaml @@ -8,7 +8,7 @@ when: - manual steps: - - name: check formatting + - name: fmt image: nixpkgs/nix:nixos-22.05 commands: - nix-shell --attr devShell --run "cargo fmt -- --check" @@ -18,18 +18,19 @@ steps: commands: - nix-build -j4 --attr flakePackages.dev - - name: unit + func tests + - name: unit + func tests (lmdb) image: nixpkgs/nix:nixos-22.05 - environment: - GARAGE_TEST_INTEGRATION_EXE: result-bin/bin/garage - GARAGE_TEST_INTEGRATION_PATH: tmp-garage-integration commands: - nix-build -j4 --attr flakePackages.tests-lmdb + + - name: unit + func tests (sqlite) + image: nixpkgs/nix:nixos-22.05 + commands: - nix-build -j4 --attr flakePackages.tests-sqlite - - rm result - name: integration tests image: nixpkgs/nix:nixos-22.05 commands: - nix-build -j4 --attr flakePackages.dev - nix-shell --attr ci --run ./script/test-smoke.sh || (cat /tmp/garage.log; false) + depends_on: [ build ] diff --git a/nix/compile.nix b/nix/compile.nix index 1e1bbb38..75156d6b 100644 --- a/nix/compile.nix +++ b/nix/compile.nix @@ -161,6 +161,8 @@ in rec { ]); }; + # ---- building garage ---- + garage-deps = craneLib.buildDepsOnly commonArgs; garage = craneLib.buildPackage (commonArgs // { @@ -173,9 +175,12 @@ in rec { GIT_VERSION = git_version; } else {})); - garage-test-deps = craneLib.buildDepsOnly (testArgs // { - cargoArtifacts = garage; - }); + # ---- testing garage ---- + + garage-test-deps = craneLib.buildDepsOnly testArgs; + # cargoArtifacts = garage would do nothing for this derivation + # because it's not the same profile + # this is a truly independent build garage-test-bin = craneLib.cargoBuild (testArgs // { cargoArtifacts = garage-test-deps;