freechat/.gitlab-ci.yml
shockrah 489fdb69b8 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
2020-08-10 17:15:29 -07:00

40 lines
635 B
YAML

image: shockrah/freechat:0.3
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:
stage: build
only:
- testing
script:
- cd server/
- diesel setup --database-url $DATABASE_URL
- cargo build --release
api-test:
stage: test
needs: ["build-release"]
only:
- testing
script:
- cd server/
- cargo run --release -- -s > server.log&
- export fc_id=$!
- cd tests/
- bash ./main.sh body
- kill ${fc_id}