forked from Skynet/discord-bot
ci: build the bot in nix in order to cache it early on
This commit is contained in:
parent
0541a70714
commit
9654963198
2 changed files with 12 additions and 5 deletions
|
@ -10,6 +10,10 @@ stages:
|
||||||
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
|
||||||
|
@ -20,6 +24,7 @@ lint-clippy:
|
||||||
- rustc --version
|
- rustc --version
|
||||||
- cargo version
|
- cargo version
|
||||||
- cargo clippy
|
- cargo clippy
|
||||||
|
- cargo test --verbose
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: never
|
when: never
|
||||||
|
@ -47,11 +52,13 @@ lint-fmt:
|
||||||
# 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 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
|
||||||
|
|
|
@ -37,4 +37,4 @@ chrono = "0.4.26"
|
||||||
lettre = "0.10.4"
|
lettre = "0.10.4"
|
||||||
maud = "0.25.0"
|
maud = "0.25.0"
|
||||||
|
|
||||||
serde = "1.0.188"
|
serde = "1.0.188"
|
Loading…
Reference in a new issue