ci: move CI tasks into Nushell scripts and update dependencies weekly
Replace the shell scripts in flake.nix with Nushell scripts in ci/, exposed as flake apps in nix/ci-tasks.nix, so every workflow command is a plain nix call. Build the workspace dependencies in a step of their own, upload to Cachix only after the builds, and run the formatting check through the pre-commit hooks. Automated pushes, tags and pull requests now use the wvhulle-bot account. A weekly cron updates Cargo.lock and flake.lock and opens or updates one pull request from bot/dependency-updates. Claude-Session: https://claude.ai/code/session_01D8dLLgYd8cfR2aQfA5eZXa
This commit is contained in:
11 files changed
+519
-173
No files matched your search
@@ -0,0 +1,85 @@
|
||||
when:
|
||||
- repo: wvhulle/bootvine
|
||||
event: [pull_request, push, manual]
|
||||
|
||||
variables:
|
||||
- &nix_config
|
||||
NIX_CONFIG: |
|
||||
experimental-features = nix-command flakes
|
||||
build-users-group =
|
||||
accept-flake-config = true
|
||||
- &after_dependency_step
|
||||
- status: [success, failure]
|
||||
|
||||
steps:
|
||||
- name: prepare-build-dependencies
|
||||
image: nixos/nix:latest
|
||||
depends_on: []
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- nix run --quiet .#build-unless-cached -- .#packages.x86_64-linux.workspace-dependencies
|
||||
|
||||
- name: build-and-test-bootvine
|
||||
image: nixos/nix:latest
|
||||
depends_on: [prepare-build-dependencies]
|
||||
when: *after_dependency_step
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- 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: [prepare-build-dependencies]
|
||||
when: *after_dependency_step
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- nix run --quiet .#import-exported-paths
|
||||
- nix run --quiet .#build-and-export-paths -- .#checks.x86_64-linux.repo-tasks-build
|
||||
|
||||
- name: lint-with-clippy
|
||||
image: nixos/nix:latest
|
||||
depends_on: [prepare-build-dependencies]
|
||||
when: *after_dependency_step
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- nix run --quiet .#import-exported-paths
|
||||
- nix build --quiet --print-build-logs .#checks.x86_64-linux.clippy-lints
|
||||
|
||||
- name: upload-builds-to-cachix
|
||||
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: run-pre-commit-hooks
|
||||
image: nixos/nix:latest
|
||||
depends_on: [prepare-build-dependencies]
|
||||
when: *after_dependency_step
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- nix run --quiet .#run-pre-commit-hooks
|
||||
|
||||
- name: evaluate-flake-outputs
|
||||
image: nixos/nix:latest
|
||||
depends_on: []
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- nix flake check --quiet --no-build
|
||||
|
||||
- name: check-commit-messages
|
||||
image: nixos/nix:latest
|
||||
depends_on: []
|
||||
when:
|
||||
- event: pull_request
|
||||
environment: *nix_config
|
||||
commands:
|
||||
- nix run --quiet .#check-commit-messages -- --fetch-target-branch FETCH_HEAD..HEAD
|
||||
Reference in new issue
Block a user