Skip to content

Instantly share code, notes, and snippets.

@rustin-huang
Forked from LukeMathWalker/.gitlab-ci.yml
Created October 11, 2022 12:37
Show Gist options
  • Select an option

  • Save rustin-huang/e6e0e61bf8267c2843b84a1420166d59 to your computer and use it in GitHub Desktop.

Select an option

Save rustin-huang/e6e0e61bf8267c2843b84a1420166d59 to your computer and use it in GitHub Desktop.
GitLab CI - Rust setup
image: "rust:latest"
default:
before_script:
- rustc --version
- cargo --version
stages:
- test
test-code:
stage: test
script:
- cargo test
- cargo install cargo-tarpaulin
- cargo tarpaulin --ignore-tests
lint-code:
stage: test
script:
- rustup component add clippy
- cargo clippy -- -D warnings
format-code:
stage: test
script:
- rustup component add rustfmt
- cargo fmt -- --check
audit-code:
stage: test
script:
- cargo install cargo-audit
- cargo audit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment