Update .gitlab-ci.yml file
This commit is contained in:
+23
-4
@@ -1,19 +1,38 @@
|
|||||||
lint-job:
|
stages:
|
||||||
stage: .pre
|
- lint
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
|
|
||||||
|
lint:
|
||||||
|
stage: lint
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
script:
|
script:
|
||||||
- rustup component add rustfmt clippy
|
- rustup component add rustfmt clippy
|
||||||
- cargo fmt --check
|
- cargo fmt --check
|
||||||
- cargo clippy -- -D warnings
|
- cargo clippy -- -D warnings
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "target/"
|
||||||
|
|
||||||
build-job:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
script:
|
script:
|
||||||
- cargo build --release
|
- cargo build --release
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "target/"
|
||||||
|
|
||||||
test-job:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
script:
|
script:
|
||||||
- cargo test --release
|
- cargo test --release
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "target/"
|
||||||
Reference in New Issue
Block a user