target/ directory was being ignore so we override that in the cache section

also changed the key to the ci_job_name
diesel setup now happens before we build the release binary
This commit is contained in:
shockrah 2020-08-10 17:15:29 -07:00
parent 0cee67ce69
commit 489fdb69b8

View File

@ -3,26 +3,25 @@ variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
cache:
key: ${CI_COMMIT_REF_SLUG}
key: "$CI_JOB_NAME"
untracked: true
paths:
- $CI_PROJECT_DIR/.cargo
- $CARGO_HOME
- $CI_PROJECT_DIR/server/target
before_script:
- export PATH="$CARGO_HOME/bin:$PATH"
build-release:
stage: build
only:
- testing
cache:
paths:
- target/
before_script:
- cd server/
script:
- cargo build --release
- cd server/
- diesel setup --database-url $DATABASE_URL
- cargo build --release
api-test: