Merge branch 'more-checks' into 'main'
Nouvelle CI permettant de faire plus de tests See merge request CoCo_Sol/border-wars!9
This commit is contained in:
commit
1541319d3f
|
@ -1,13 +1,66 @@
|
|||
stages:
|
||||
- checks
|
||||
- build
|
||||
|
||||
cargo-test:
|
||||
image: rust:latest
|
||||
stage: checks
|
||||
before_script:
|
||||
- apt-get update && apt-get install libasound2-dev libudev-dev -y
|
||||
script:
|
||||
- cargo test --workspace
|
||||
rules:
|
||||
- exists:
|
||||
- Cargo.toml
|
||||
|
||||
cargo-clippy:
|
||||
image: rust:latest
|
||||
stage: checks
|
||||
before_script:
|
||||
- apt-get update && apt-get install libasound2-dev libudev-dev -y
|
||||
- rustup component add clippy
|
||||
script:
|
||||
- rustc --version && cargo --version
|
||||
- cargo clippy --workspace
|
||||
- cargo test --workspace
|
||||
rules:
|
||||
- exists:
|
||||
- Cargo.toml
|
||||
|
||||
cargo-fmt:
|
||||
image: rust:latest
|
||||
stage: checks
|
||||
before_script:
|
||||
- rustup install nightly --profile minimal
|
||||
- rustup component add rustfmt --toolchain nightly
|
||||
script:
|
||||
- cargo +nightly fmt --check
|
||||
rules:
|
||||
- exists:
|
||||
- Cargo.toml
|
||||
|
||||
development-image:
|
||||
image: docker:latest
|
||||
stage: build
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
|
||||
exists:
|
||||
- Dockerfile
|
||||
|
||||
production-image:
|
||||
image: docker:latest
|
||||
stage: build
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- docker build -t $CI_REGISTRY_IMAGE:latest
|
||||
- docker push $CI_REGISTRY_IMAGE:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
exists:
|
||||
- Dockerfile
|
||||
|
|
19
rustfmt.toml
Normal file
19
rustfmt.toml
Normal file
|
@ -0,0 +1,19 @@
|
|||
use_try_shorthand = true
|
||||
use_field_init_shorthand = true
|
||||
use_small_heuristics = "Max"
|
||||
|
||||
version = "Two"
|
||||
error_on_line_overflow = true
|
||||
error_on_unformatted = true
|
||||
|
||||
format_code_in_doc_comments = true
|
||||
format_macro_bodies = true
|
||||
format_macro_matchers = true
|
||||
format_strings = true
|
||||
|
||||
imports_granularity = "Module"
|
||||
group_imports = "StdExternalCrate"
|
||||
|
||||
normalize_doc_attributes = true
|
||||
normalize_comments = true
|
||||
wrap_comments = true
|
Loading…
Reference in a new issue