
also changed the key to the ci_job_name diesel setup now happens before we build the release binary
40 lines
635 B
YAML
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}
|
|
|