91 lines
1.8 KiB
YAML
91 lines
1.8 KiB
YAML
stages:
|
|
- build
|
|
- test
|
|
- release
|
|
|
|
cache: &global_cache
|
|
key:
|
|
files:
|
|
- Cargo.lock
|
|
- Cargo.toml
|
|
paths:
|
|
- target/debug/deps
|
|
- target/debug/build
|
|
policy: pull-push
|
|
|
|
variables:
|
|
RUSTFLAGS: "-Dwarnings"
|
|
|
|
build:
|
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
|
stage: build
|
|
cache:
|
|
<<: *global_cache
|
|
script:
|
|
- cargo +nightly build --workspace
|
|
|
|
test:
|
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
|
stage: test
|
|
cache:
|
|
<<: *global_cache
|
|
script:
|
|
- cargo +nightly test --workspace
|
|
|
|
lint:
|
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
|
stage: test
|
|
cache:
|
|
<<: *global_cache
|
|
script:
|
|
- cargo +nightly fmt --all -- --check
|
|
- cargo +nightly clippy --workspace --all-targets --all-features
|
|
|
|
depcheck:
|
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
|
stage: test
|
|
cache:
|
|
<<: *global_cache
|
|
script:
|
|
- cargo +nightly outdated
|
|
- cargo +nightly udeps --workspace --all-targets
|
|
|
|
build-release:
|
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
|
stage: release
|
|
cache:
|
|
<<: *global_cache
|
|
script:
|
|
- cargo +nightly build --release
|
|
after_script:
|
|
- echo "JOB_ID=$CI_JOB_ID" >> job.env
|
|
artifacts:
|
|
paths:
|
|
- target/release/qrust
|
|
expire_in: 1d
|
|
reports:
|
|
dotenv: job.env
|
|
only:
|
|
- tags
|
|
|
|
release:
|
|
image: registry.gitlab.com/gitlab-org/release-cli
|
|
stage: release
|
|
needs:
|
|
- job: build-release
|
|
artifacts: true
|
|
script:
|
|
- echo "Create Release $CI_COMMIT_TAG"
|
|
release:
|
|
name: Release $CI_COMMIT_TAG
|
|
tag_name: $CI_COMMIT_TAG
|
|
description: Release $CI_COMMIT_SHA
|
|
ref: $CI_COMMIT_TAG
|
|
assets:
|
|
links:
|
|
- name: qrust
|
|
url: https://gitlab.com/karaolidis/qrust/-/jobs/$CI_JOB_ID/artifacts/raw/target/release/qrust
|
|
link_type: other
|
|
only:
|
|
- tags
|