adding build caching and delaying tests as cargo is slow to start up sometimes

This commit is contained in:
shockrah 2020-08-09 23:28:04 -07:00
parent 776ceb83c9
commit bae3e02b48

View File

@ -1,10 +1,16 @@
image: shockrah/freechat:0.3 image: shockrah/freechat:0.3
debug-build: build-release:
stage: build stage: build
only: only:
- testing - testing
cache:
paths:
- target/
- $CI_HOME_DIR/.cargo/
script: script:
- CARGO_HOME=$CI_PROJECT_DIR/.cargo
- cd server/ - cd server/
- cargo build - cargo build
- diesel setup --database-url $DATABASE_URL - diesel setup --database-url $DATABASE_URL
@ -13,12 +19,15 @@ debug-build:
basic-test: basic-test:
stage: test stage: test
needs: "build-release"
only: only:
- testing - testing
script: script:
- cd server/ - cd server/
- cargo run -- -s& - cargo run -- -s&
- fc_id=$! - fc_id=$!
- echo Sleeping to let cargo catch up
- sleep 3
- cd tests/ - cd tests/
- bash ./main.sh body - bash ./main.sh body
- kill ${fc_id} - kill ${fc_id}