From bae3e02b489b189dcbba70595d8d2f5dd7ddbd4a Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 9 Aug 2020 23:28:04 -0700 Subject: [PATCH] adding build caching and delaying tests as cargo is slow to start up sometimes --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eeeb220..ba50f89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,16 @@ image: shockrah/freechat:0.3 -debug-build: +build-release: stage: build only: - testing + cache: + paths: + - target/ + - $CI_HOME_DIR/.cargo/ + script: + - CARGO_HOME=$CI_PROJECT_DIR/.cargo - cd server/ - cargo build - diesel setup --database-url $DATABASE_URL @@ -13,12 +19,15 @@ debug-build: basic-test: stage: test + needs: "build-release" only: - testing script: - cd server/ - cargo run -- -s& - fc_id=$! + - echo Sleeping to let cargo catch up + - sleep 3 - cd tests/ - bash ./main.sh body - kill ${fc_id}