From a4042927b7a001f6e523a5a78898b63bd34fb687 Mon Sep 17 00:00:00 2001 From: Ivar Flakstad <69173633+ivarflakstad@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:24:52 +0200 Subject: [PATCH] Add initial rust CI: testing with coverage report, and formatting/linting --- .github/workflows/rust.yaml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/rust.yaml diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml new file mode 100644 index 00000000..fab1a939 --- /dev/null +++ b/.github/workflows/rust.yaml @@ -0,0 +1,38 @@ +name: Rust CI + +on: push + +defaults: + run: + working-directory: server + +env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 + RUST_BACKTRACE: short + RUSTFLAGS: "-D warnings" + RUSTUP_MAX_RETRIES: 10 + +jobs: + coverage-and-linting: + name: Test coverage & linting + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust Toolchain + uses: ./.github/actions/toolchain-cargo-cached + with: + components: llvm-tools-preview, rustfmt, clippy + crates: cargo-llvm-cov + + - name: Tests & coverage + run: cargo llvm-cov test --no-fail-fast --workspace + + - name: Linting rustfmt + run: cargo fmt --all -- --check + + - name: Linting clippy + run: cargo clippy -- \ No newline at end of file