From e4c6c46061bc98d306d5e5054065491df63d1f97 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 10 Aug 2020 13:44:18 -0700 Subject: [PATCH] Proper build caching and updating needs field for testing stage --- .gitlab-ci.yml | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9aa6660..9ceb6a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,32 +1,33 @@ image: shockrah/freechat:0.3 +variables: + CARGO_HOME: $CI_PROJECT_DIR/.cargo build-release: - stage: build - only: - - testing - cache: + stage: build + only: + - testing + cache: paths: - - target/ - - $CI_HOME_DIR/.cargo/ + - target/ - script: - - CARGO_HOME=$CI_PROJECT_DIR/.cargo - - cd server/ - - cargo build - - diesel setup --database-url $DATABASE_URL + before_script: + - cd server/ + script: + - cargo build + - diesel setup --database-url $DATABASE_URL -basic-test: - stage: test - needs: ["build-release"] - only: - - testing - script: - - cd server/ - - cargo run -- -s - - fc_id=$! - - cd tests/ - - bash ./main.sh body - - kill ${fc_id} +api-test: + stage: test + needs: ["build-release"] + only: + - testing + script: + - cd server/ + - cargo run -- -s > server.log& + - export fc_id=$! + - cd tests/ + - bash ./main.sh body + - kill ${fc_id}