From 03f9f3bfad6cc93324f0bb76d2a2813047c11462 Mon Sep 17 00:00:00 2001 From: Vladimir Trifonov Date: Wed, 17 Apr 2024 14:01:22 +0300 Subject: [PATCH 1/2] chore: add the test, rustfmt and clippy jobs. --- .github/workflows/cI.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/cI.yml diff --git a/.github/workflows/cI.yml b/.github/workflows/cI.yml new file mode 100644 index 0000000..bae955e --- /dev/null +++ b/.github/workflows/cI.yml @@ -0,0 +1,55 @@ +name: Continuous Integration + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + +jobs: + clippy: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2024-02-01 + components: clippy + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - run: cargo clippy --workspace --all-targets --all-features + env: + RUSTFLAGS: -Dwarnings + + rustfmt: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2024-02-01 + components: rustfmt + - run: cargo fmt --all --check + + test: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2024-02-01 + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - run: cargo test --workspace From 535781b5791ec48d3cb9c976419ada1ba9c050a4 Mon Sep 17 00:00:00 2001 From: Vladimir Trifonov Date: Wed, 17 Apr 2024 15:26:38 +0300 Subject: [PATCH 2/2] fix: use latest nightly release for the ci jobs --- .github/workflows/cI.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cI.yml b/.github/workflows/cI.yml index bae955e..c9de39c 100644 --- a/.github/workflows/cI.yml +++ b/.github/workflows/cI.yml @@ -19,9 +19,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2024-02-01 components: clippy - uses: Swatinem/rust-cache@v2 with: @@ -35,9 +34,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2024-02-01 components: rustfmt - run: cargo fmt --all --check @@ -46,9 +44,7 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2024-02-01 + - uses: dtolnay/rust-toolchain@nightly - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true