2022-07-15 21:27:25 +12:00
|
|
|
image: rust:latest
|
2022-07-15 22:27:26 +12:00
|
|
|
stages:
|
2022-07-15 21:27:25 +12:00
|
|
|
- dependencies
|
|
|
|
- test
|
|
|
|
- release
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: dependencies
|
|
|
|
cache:
|
|
|
|
key: "$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- $HOME/.cargo
|
2022-09-27 15:36:39 +13:00
|
|
|
- target/
|
2022-07-15 21:27:25 +12:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- $HOME/.cargo
|
2022-09-27 15:36:39 +13:00
|
|
|
- target/
|
2022-07-15 21:27:25 +12:00
|
|
|
expire_in: 60 mins
|
|
|
|
script:
|
|
|
|
- cargo test --no-run --release
|
|
|
|
|
|
|
|
cargo test:
|
2022-07-15 22:27:26 +12:00
|
|
|
stage: test
|
2022-07-15 21:27:25 +12:00
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
script:
|
|
|
|
- rustc --version && cargo --version
|
|
|
|
- cargo test --jobs 1 --release
|
|
|
|
|
|
|
|
cargo clippy:
|
|
|
|
stage: test
|
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
before_script:
|
|
|
|
- rustup component add clippy
|
|
|
|
script:
|
|
|
|
- cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
# cargo publish:
|
|
|
|
# stage: release
|
|
|
|
# dependencies:
|
|
|
|
# - build
|
|
|
|
# only:
|
|
|
|
# - /^v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
|
|
# except:
|
|
|
|
# - branches
|
|
|
|
# script:
|
|
|
|
# - cargo publish --token $CARGO_TOKEN
|
2022-09-27 15:36:39 +13:00
|
|
|
|
|
|
|
pages:
|
|
|
|
stage: release
|
|
|
|
image: docker:stable
|
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
script:
|
|
|
|
- docker run -u "$(id -u):$(id -g)" -v $PWD:/app --workdir /app ghcr.io/getzola/zola:v0.16.0 --root outrun-site/ build --output-dir public
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|