freechat/.gitlab-ci.yml

108 lines
1.7 KiB
YAML

image: shockrah/freechat:0.4
stages:
- build
- test
workflow:
rules:
- if: '$CI_COMMIT_BRANCH'
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
GIT_SUBMODULE_STRATEGY: recursive
SHOPTS: "-o StrictHostKeyChecking=no"
before_script:
- export PATH="$CARGO_HOME/bin:$PATH"
build-json-api:
# Literally so expensive that I realy just don't wanna deal with it
stage: build
only:
refs:
- master
changes:
- json-api/Cargo.*
- json-api/src/*
- json-api/src/testing/*
- json-api/migrations/**/*
- json-api/client-tests/**/*
- json-api/build.sh
- json-api/db/Cargo.*
- json-api/db/src/*
script:
- cd json-api/
- cargo build --release
# primarily used to cache between jobs
# expirey time overwritten later for weekly builds
artifacts:
paths:
- json-api/target/
- $CARGO_HOME
expire_in: 15 mins
test-json-api:
stage: test
needs:
- build-json-api
only:
refs:
- master
changes:
- json-api/Cargo.*
- json-api/src/*
- json-api/src/testing/*
- json-api/migrations/**/*
- json-api/client-tests/**/*
- json-api/build.sh
- json-api/db/Cargo.*
- json-api/db/src/*
dependencies:
- build-json-api
script:
- cd json-api/
- cargo test --release
artifacts:
paths:
- json-api/target/release/json-api
expire_in: 1 week
name: json-api
build-wiki:
image: registry.gitlab.com/pages/hugo:latest
only: [ "master" ]
stage: build
script:
- cd docs/
- hugo
- ssh $SHOPTS web@shockrah.xyz "rm -rf /var/www/freechat"
- scp $SHOPTS -r public/ web@shockrah.xyz:/var/www/freechat
artifacts:
paths:
- public