From 173f233e1d8159d0966dc8f2c90c77e4a223a09b Mon Sep 17 00:00:00 2001 From: Antony David Date: Fri, 23 Aug 2024 16:44:32 +0200 Subject: [PATCH 1/2] refactor: parallel jobs and add tool chain --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++------------ rust-toolchain.toml | 5 +++++ 2 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f75adda..9db280f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,32 +11,42 @@ env: CARGO_TERM_COLOR: always RUST_LOG: info RUST_BACKTRACE: 1 + RUSTFLAGS: "-Dwarnings" CI: true jobs: - ci: + code-quality: + name: Code Quality runs-on: ubuntu-latest steps: - - name: Checkout code + - name: ๐Ÿ“ฅ Checkout code uses: actions/checkout@v4 - - name: Install toolchain + - name: ๐Ÿ› ๏ธ Install Rust toolchain uses: moonrepo/setup-rust@v1 with: - components: clippy,rustfmt - cache-base: main - bins: cargo-tarpaulin - - - name: Check formatting + components: clippy,rustfmt + + - name: ๐ŸŽจ Check formatting run: cargo fmt --all --check - - name: Run Clippy + - name: ๐Ÿ” Run Clippy run: cargo clippy - - name: Run Build - run: cargo build + build-and-test: + name: Build and Test + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ› ๏ธ Install Rust toolchain + uses: moonrepo/setup-rust@v1 + + - name: ๐Ÿ—๏ธ Build + run: cargo build --release - - name: Run tests with coverage + - name: ๐Ÿงช Run tests with coverage run: | cargo tarpaulin --all-features --workspace --out xml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..1d0fd56 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +# The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. +# https://rust-lang.github.io/rustup/concepts/profiles.html +profile = "default" +channel = "1.80" From 45cb5a5f52deb88246bb66a157738eeb71e5e1c6 Mon Sep 17 00:00:00 2001 From: Antony David Date: Fri, 23 Aug 2024 16:47:41 +0200 Subject: [PATCH 2/2] fix: missing tarpaulin bin --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9db280f..09c45c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,8 @@ jobs: - name: ๐Ÿ› ๏ธ Install Rust toolchain uses: moonrepo/setup-rust@v1 + with: + bins: cargo-tarpaulin - name: ๐Ÿ—๏ธ Build run: cargo build --release