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 +