From 1ef684ec1322783d0c78dbc625dde3e4a2bc1594 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 13 Feb 2025 08:24:01 +0100 Subject: [PATCH] chore: setup toolchain and update CI (#45) --- .github/workflows/codecov.yml | 11 ++------- .github/workflows/main.yml | 37 ++++++---------------------- .github/workflows/release.yml | 6 +---- .gitignore | 3 ++- overwatch-rs/tests/state_handling.rs | 2 +- rust-toolchain.toml | 2 ++ rustfmt.toml | 2 ++ 7 files changed, 17 insertions(+), 46 deletions(-) create mode 100644 rust-toolchain.toml create mode 100644 rustfmt.toml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index af52c60..ac9acff 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -12,17 +12,10 @@ jobs: RUSTFLAGS: -C instrument-coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: llvm-tools-preview - - uses: actions-rs/cargo@v1 - continue-on-error: true + - run: rustup component add llvm-tools-preview - run: | cargo install grcov; cargo test --all-features; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9929570..cb23e4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,18 +8,13 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - uses: actions-rs/cargo@v1 - continue-on-error: false with: command: check + args: --all --all-targets --all-features test: name: Test Suite @@ -28,47 +23,29 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - uses: actions-rs/cargo@v1 - continue-on-error: false - with: - command: build - - uses: actions-rs/cargo@v1 - continue-on-error: false with: command: test + args: --all-targets --all-features lints: name: Rust lints runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy - - name: Run cargo fmt uses: actions-rs/cargo@v1 - continue-on-error: false with: command: fmt - args: --all -- --check - + args: --all --check - name: Run cargo clippy uses: actions-rs/cargo@v1 continue-on-error: false with: command: clippy - args: -- --deny warnings + args: --all-targets --all-features -- --deny warnings diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3034495..e2e7a62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,11 +8,7 @@ name: Release jobs: release: steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + - uses: actions/checkout@v4 - uses: katyo/publish-crates@v1 with: registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.gitignore b/.gitignore index 395be6f..b637b25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **target/ .idea/ -Cargo.lock \ No newline at end of file +Cargo.lock +.vscode \ No newline at end of file diff --git a/overwatch-rs/tests/state_handling.rs b/overwatch-rs/tests/state_handling.rs index ac65186..85821bb 100644 --- a/overwatch-rs/tests/state_handling.rs +++ b/overwatch-rs/tests/state_handling.rs @@ -15,7 +15,7 @@ pub struct UpdateStateService { } #[derive(Clone, Debug)] -pub struct UpdateStateServiceMessage(String); +pub struct UpdateStateServiceMessage; impl RelayMessage for UpdateStateServiceMessage {} diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..292fe49 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..745fb75 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +reorder_imports = true +reorder_modules = true