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.
95 lines
2.8 KiB
YAML
95 lines
2.8 KiB
YAML
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]
|
|
- &on_pull_requests
|
|
- event: pull_request
|
|
|
|
steps:
|
|
- name: build-workspace-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: [build-workspace-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: [build-workspace-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-rust-with-clippy
|
|
image: nixos/nix:latest
|
|
depends_on: [build-workspace-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: check-rust-formatting
|
|
image: nixos/nix:latest
|
|
depends_on: [build-workspace-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.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 --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
|
|
depends_on: []
|
|
when: *on_pull_requests
|
|
environment: *nix_config
|
|
commands:
|
|
- nix run --quiet .#check-conventional-commits -- --fetch-target-branch FETCH_HEAD..HEAD
|