From 9654963198a308cd010ffb5df98fbbeb723d3d27 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 3 Jun 2024 20:55:39 +0100 Subject: [PATCH] ci: build the bot in nix in order to cache it early on --- .gitlab-ci.yml | 15 +++++++++++---- Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a362ccb..4800144 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,10 @@ stages: 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 @@ -20,6 +24,7 @@ lint-clippy: - rustc --version - cargo version - cargo clippy + - cargo test --verbose rules: - if: $CI_COMMIT_TAG when: never @@ -47,11 +52,13 @@ lint-fmt: # 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 build --verbose rules: - if: $CI_COMMIT_TAG when: never diff --git a/Cargo.toml b/Cargo.toml index eda0abd..a26023a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,4 +37,4 @@ chrono = "0.4.26" lettre = "0.10.4" maud = "0.25.0" -serde = "1.0.188" +serde = "1.0.188" \ No newline at end of file