ci: improvements to teh build process
This commit is contained in:
parent
c1b42a8132
commit
7ca705cc0a
3 changed files with 19 additions and 13 deletions
|
@ -6,15 +6,14 @@ stages:
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
cache:
|
|
||||||
key: "$CI_JOB_NAME"
|
|
||||||
paths:
|
|
||||||
- target/
|
|
||||||
|
|
||||||
# Set any required environment variables here
|
# Set any required environment variables here
|
||||||
variables:
|
variables:
|
||||||
RUST_BACKTRACE: FULL
|
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
|
# clippy and fmt are magic
|
||||||
# runs on all commits/branches
|
# runs on all commits/branches
|
||||||
|
@ -30,7 +29,7 @@ lint-clippy:
|
||||||
when: never
|
when: never
|
||||||
- changes:
|
- changes:
|
||||||
- src/**/*
|
- src/**/*
|
||||||
- cargo.*
|
- Cargo.*
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
lint-fmt:
|
lint-fmt:
|
||||||
|
@ -45,24 +44,26 @@ lint-fmt:
|
||||||
when: never
|
when: never
|
||||||
- changes:
|
- changes:
|
||||||
- src/**/*
|
- src/**/*
|
||||||
- cargo.*
|
- Cargo.*
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
|
|
||||||
# has to actually compile
|
# has to actually compile
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
tags:
|
||||||
|
- nix
|
||||||
|
before_script:
|
||||||
|
- *scripts_cache
|
||||||
script:
|
script:
|
||||||
- rustc --version
|
- attic watch-store skynet-cache &
|
||||||
- cargo version
|
- nix --extra-experimental-features "nix-command flakes" build --verbose
|
||||||
- cargo build --verbose
|
|
||||||
- RUST_BACKTRACE=1 cargo test --verbose
|
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: never
|
when: never
|
||||||
- changes:
|
- changes:
|
||||||
- src/**/*
|
- src/**/*
|
||||||
- cargo.*
|
- Cargo.*
|
||||||
when: on_success
|
when: on_success
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,11 @@
|
||||||
utils.url = "github:numtide/flake-utils";
|
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:
|
outputs = { self, nixpkgs, utils, naersk }: utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages."${system}";
|
pkgs = nixpkgs.legacyPackages."${system}";
|
||||||
|
|
Loading…
Reference in a new issue