89
.gitlab-ci.yml
Normal file
89
.gitlab-ci.yml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
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 build --verbose
|
||||||
|
|
||||||
|
test:
|
||||||
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
||||||
|
stage: test
|
||||||
|
cache:
|
||||||
|
<<: *global_cache
|
||||||
|
script:
|
||||||
|
- cargo test --verbose
|
||||||
|
|
||||||
|
lint:
|
||||||
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
||||||
|
stage: test
|
||||||
|
cache:
|
||||||
|
<<: *global_cache
|
||||||
|
script:
|
||||||
|
- cargo clippy --all-targets --all-features
|
||||||
|
|
||||||
|
depcheck:
|
||||||
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
||||||
|
stage: test
|
||||||
|
cache:
|
||||||
|
<<: *global_cache
|
||||||
|
script:
|
||||||
|
- cargo outdated
|
||||||
|
- cargo +nightly udeps
|
||||||
|
|
||||||
|
build-release:
|
||||||
|
image: registry.karaolidis.com/karaolidis/qrust/rust
|
||||||
|
stage: release
|
||||||
|
cache:
|
||||||
|
<<: *global_cache
|
||||||
|
script:
|
||||||
|
- cargo build --release --verbose
|
||||||
|
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
|
5
support/ci/Dockerfile
Normal file
5
support/ci/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM rust
|
||||||
|
|
||||||
|
RUN rustup install nightly
|
||||||
|
RUN rustup component add clippy
|
||||||
|
RUN cargo install cargo-udeps cargo-outdated
|
Reference in New Issue
Block a user