From 8dd42606bd147c4f7ea1fda6f99c0578068ca456 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 9 Feb 2021 14:58:20 -0800 Subject: [PATCH] New pipeline script for master branch updated to support new project structure --- .gitlab-ci.yml | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d2ef29..4876f13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,35 +1,48 @@ image: shockrah/freechat:0.3 + +stages: + - build + - test + variables: CARGO_HOME: $CI_PROJECT_DIR/.cargo -cache: - key: "$CI_JOB_NAME" - untracked: true - paths: - - $CARGO_HOME - - $CI_PROJECT_DIR/server/target - before_script: - export PATH="$CARGO_HOME/bin:$PATH" -build-release: + +build-json-api: + # Literally so expensive that I realy just don't wanna deal with it stage: build - only: - - testing + when: manual + only: [ "master" ] script: - - cd server/ - - diesel setup --database-url $DATABASE_URL + - cd json-api/ - cargo build --release + + # primarily used to cache between jobs + # expirey time overwritten later for weekly builds + artifacts: + paths: + - json-api/target/release/json-api + expire_in: 15 mins -api-test: + +test-json-api: stage: test - needs: ["build-release"] - only: - - testing + needs: + - build-json-api + script: - - cd server/ + - cd json-api/ - cargo test --release + artifacts: + paths: + - json-api/target/release/json-api + expire_in: 1 week + name: json-api +