ci: move CI scripting into Nushell scripts with separate dependency steps

Replace the shell wrappers build-and-push-to-cachix, check-conventional-commits
and the release-plz apps with Nushell scripts in ci/, and move the git commands
out of the workflow YAML, so that every workflow command is a plain nix call.

Build the workspace dependencies in their own step, skipped when already in
Cachix. Later steps import the exported paths and also run after an earlier
failure. A separate step alone holds the Cachix token and uploads on main.
Pull requests run the same steps without the upload.

Wrap the recording tasks with makeBinaryWrapper instead of shell, and run the
CI task tests in a step of their own.
This commit is contained in:
Willem Vanhulle committed 2026-11-04 20:02:26 +01:00
1 parent d0833ad563
commit ce72695e29
8 files changed
+338 -84

No files matched your search

+2 -4
View File
@@ -34,12 +34,10 @@ steps:
image: nixos/nix:latest
environment: *release_env
commands:
- git remote set-url origin "https://wvhulle:$${CODEBERG_TOKEN}@codeberg.org/$${CI_REPO}.git"
- git checkout -B main "$${CI_COMMIT_SHA}"
- nix run .#release-plz-release
- nix run --quiet .#release-plz-release
- name: update-release-pr
image: nixos/nix:latest
environment: *release_env
commands:
- nix run .#release-plz-release-pr
- nix run --quiet .#release-plz-release-pr
+44 -37
View File
@@ -8,74 +8,82 @@ variables:
experimental-features = nix-command flakes
build-users-group =
accept-flake-config = true
- &cache_writing_env
<<: *nix_config
CACHIX_AUTH_TOKEN:
from_secret: cachix_auth_token
- &on_main_branch
- event: [push, manual]
branch: main
- &off_main_branch
- event: pull_request
- event: [push, manual]
branch:
exclude: main
- &after_dependency_step
- status: [success, failure]
- &on_pull_requests
- event: pull_request
steps:
- name: build-test-and-cache-bootvine
- name: build-workspace-dependencies
image: nixos/nix:latest
depends_on: []
when: *on_main_branch
environment: *cache_writing_env
environment: *nix_config
commands:
- nix run .#build-and-push-to-cachix -- .#checks.x86_64-linux.bootvine-build
- nix run --quiet .#build-unless-cached -- .#packages.x86_64-linux.workspace-dependencies
- name: build-and-test-bootvine
image: nixos/nix:latest
depends_on: []
when: *off_main_branch
depends_on: [build-workspace-dependencies]
when: *after_dependency_step
environment: *nix_config
commands:
- nix build --print-build-logs .#checks.x86_64-linux.bootvine-build
- name: build-and-cache-repo-tasks
image: nixos/nix:latest
depends_on: []
when: *on_main_branch
environment: *cache_writing_env
commands:
- nix run .#build-and-push-to-cachix -- .#checks.x86_64-linux.repo-tasks-build
- nix run --quiet .#import-exported-paths
- nix run --quiet .#build-and-export-paths -- .#checks.x86_64-linux.bootvine-build
- name: build-repo-tasks
image: nixos/nix:latest
depends_on: []
when: *off_main_branch
depends_on: [build-workspace-dependencies]
when: *after_dependency_step
environment: *nix_config
commands:
- nix build --print-build-logs .#checks.x86_64-linux.repo-tasks-build
- nix run --quiet .#import-exported-paths
- nix run --quiet .#build-and-export-paths -- .#checks.x86_64-linux.repo-tasks-build
- name: lint-rust-with-clippy
image: nixos/nix:latest
depends_on: []
depends_on: [build-workspace-dependencies]
when: *after_dependency_step
environment: *nix_config
commands:
- nix build --print-build-logs .#checks.x86_64-linux.clippy-lints
- nix run --quiet .#import-exported-paths
- nix build --quiet --print-build-logs .#checks.x86_64-linux.clippy-lints
- name: check-rust-formatting
image: nixos/nix:latest
depends_on: []
depends_on: [build-workspace-dependencies]
when: *after_dependency_step
environment: *nix_config
commands:
- nix build --print-build-logs .#checks.x86_64-linux.rustfmt-formatting
- nix run --quiet .#import-exported-paths
- nix build --quiet --print-build-logs .#checks.x86_64-linux.rustfmt-formatting
- name: upload-build-cache
image: nixos/nix:latest
depends_on: [build-and-test-bootvine, build-repo-tasks]
when:
- event: [push, manual]
branch: main
status: [success, failure]
environment:
<<: *nix_config
CACHIX_AUTH_TOKEN:
from_secret: cachix_auth_token
commands:
- nix run --quiet .#upload-exported-paths
- name: evaluate-flake-outputs
image: nixos/nix:latest
depends_on: []
environment: *nix_config
commands:
- nix flake check --no-build
- nix flake check --quiet --no-build
- name: test-ci-tasks
image: nixos/nix:latest
depends_on: []
environment: *nix_config
commands:
- nix build --quiet --print-build-logs .#checks.x86_64-linux.ci-task-tests
- name: check-conventional-commit-messages
image: nixos/nix:latest
@@ -83,5 +91,4 @@ steps:
when: *on_pull_requests
environment: *nix_config
commands:
- git fetch --quiet origin "$${CI_COMMIT_TARGET_BRANCH}"
- nix run .#check-conventional-commits -- FETCH_HEAD..HEAD
- nix run --quiet .#check-conventional-commits -- --fetch-target-branch FETCH_HEAD..HEAD