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.
15 lines
755 B
Nu
Executable File
15 lines
755 B
Nu
Executable File
#!/usr/bin/env nu
|
|
|
|
use std/assert
|
|
use ./nix-built-paths.nu [nix-config-with-hook store-paths-from-lines]
|
|
use ./release-tasks.nu [authenticated-origin-url]
|
|
|
|
def main []: nothing -> nothing {
|
|
assert equal (nix-config-with-hook "max-jobs = 1" "/nix/store/hook") "max-jobs = 1\npost-build-hook = /nix/store/hook"
|
|
assert equal (nix-config-with-hook "" "/nix/store/hook") "\npost-build-hook = /nix/store/hook"
|
|
assert equal ("/nix/store/first\n\n/nix/store/second\n" | store-paths-from-lines) ["/nix/store/first" "/nix/store/second"]
|
|
assert equal ("" | store-paths-from-lines) []
|
|
assert equal (authenticated-origin-url "wvhulle/bootvine" "sample-token") "https://wvhulle:sample-token@codeberg.org/wvhulle/bootvine.git"
|
|
print "CI task tests passed"
|
|
}
|