ci: improvements to teh build process

This commit is contained in:
silver 2024-06-03 23:57:34 +01:00
parent c1b42a8132
commit 7ca705cc0a
3 changed files with 19 additions and 13 deletions

View file

@ -6,15 +6,14 @@ stages:
- build
- deploy
cache:
key: "$CI_JOB_NAME"
paths:
- target/
# Set any required environment variables here
variables:
RUST_BACKTRACE: FULL
.scripts_cache: &scripts_cache
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#attic-client
- attic login skynet https://nix-cache.skynet.ie/ $CACHE_KEY
- attic use skynet-cache
# clippy and fmt are magic
# runs on all commits/branches
@ -30,7 +29,7 @@ lint-clippy:
when: never
- changes:
- src/**/*
- cargo.*
- Cargo.*
when: always
lint-fmt:
@ -45,24 +44,26 @@ lint-fmt:
when: never
- changes:
- src/**/*
- cargo.*
- Cargo.*
when: always
# has to actually compile
build:
stage: build
tags:
- nix
before_script:
- *scripts_cache
script:
- rustc --version
- cargo version
- cargo build --verbose
- RUST_BACKTRACE=1 cargo test --verbose
- attic watch-store skynet-cache &
- nix --extra-experimental-features "nix-command flakes" build --verbose
rules:
- if: $CI_COMMIT_TAG
when: never
- changes:
- src/**/*
- cargo.*
- Cargo.*
when: on_success

View file

@ -39,4 +39,4 @@ lettre = "0.10.4"
maud = "0.25.0"
# verifying ssh keys
ssh-key = { version = "0.6.1", features = ["crypto", "dsa"] }
ssh-key = { version = "0.6.1", features = ["crypto", "dsa"] }

View file

@ -6,6 +6,11 @@
naersk.url = "github:nix-community/naersk";
utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = "https://nix-cache.skynet.ie/skynet-cache";
extra-trusted-public-keys = "skynet-cache:zMFLzcRZPhUpjXUy8SF8Cf7KGAZwo98SKrzeXvdWABo=";
};
outputs = { self, nixpkgs, utils, naersk }: utils.lib.eachDefaultSystem (system:
let