chore: set up pre-commit checks

This commit is contained in:
Marc Plano-Lesay 2025-05-04 21:46:13 +10:00
parent a0ffa68948
commit b10f83ea27
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
5 changed files with 176 additions and 43 deletions

View file

@ -18,6 +18,28 @@ tests:
- cargo fmt --check
- cargo test
flake-check:
stage: test
image: nixpkgs/nix-flakes:nixos-24.11-x86_64-linux
before_script:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- chmod 400 "$NIX_SSH_PRIVATE_KEY"
- ssh-add "$NIX_SSH_PRIVATE_KEY"
- cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "substituters = ssh://nix-ssh@build.enoent.fr?priority=10 https://cache.nixos.org?priority=40 https://cuda-maintainers.cachix.org https://nix-community.cachix.org https://statix.cachix.org https://pre-commit-hooks.cachix.org" >> /etc/nix/nix.conf
- echo "trusted-substituters = ssh://nix-ssh@build.enoent.fr" >> /etc/nix/nix.conf
- echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= statix.cachix.org-1:Z9E/g1YjCjU117QOOt07OjhljCoRZddiAm4VVESvais= pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" >> /etc/nix/nix.conf
- echo "extra-trusted-public-keys = galatea-0:E7F1FzfoY+X9l9Xn9AvNWDkW1U7H644FHDzX3lpxHkI=" >> /etc/nix/nix.conf
- echo "builders-use-substitutes = true" >> /etc/nix/nix.conf
- echo "max-jobs = 0" >> /etc/nix/nix.conf
- echo "ssh://nix-ssh@build.enoent.fr x86_64-linux" >> /etc/nix/machines
- echo "ssh://nix-ssh@build.enoent.fr aarch64-linux" >> /etc/nix/machines
- nix store info --store ssh://nix-ssh@build.enoent.fr
script:
- nix flake check
build:amd64:
stage: build
image: rust