From 9672fea00e164badd5b51a536263d13d1ffc1426 Mon Sep 17 00:00:00 2001 From: Skyf0l <59019720+skyf0l@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:18:30 +0200 Subject: [PATCH 1/3] chore: better ci --- .github/workflows/ci.yml | 66 ++++++++++++---------------------------- 1 file changed, 19 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5df480..b474f56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: [main] - tags: ["*"] + tags: ['v*'] pull_request: branches: [main] @@ -19,10 +19,8 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Stable toolchain with rustfmt - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable components: rustfmt - uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 @@ -37,10 +35,8 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Stable toolchain with clippy - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable components: clippy - uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 @@ -56,11 +52,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Stable toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - run: cargo doc --no-deps @@ -72,16 +64,14 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Stable toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - - uses: taiki-e/install-action@ef7090108a583d4124f188b4958359153b2d19e1 # nextest + - uses: taiki-e/install-action@30bcc3acc9b9fc2ef5216c3b9c1946223a581691 # v2.41.13 + with: + tool: cargo-nextest - name: Test - run: cargo nextest run --all-features + run: cargo nextest run --all-features --lib --bins --test keys coverage: name: Coverage @@ -90,32 +80,22 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Stable toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - toolchain: nightly - override: true + - uses: dtolnay/rust-toolchain@nightly - uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 - - uses: taiki-e/install-action@ef7090108a583d4124f188b4958359153b2d19e1 # nextest + - uses: taiki-e/install-action@30bcc3acc9b9fc2ef5216c3b9c1946223a581691 # v2.41.13 + with: + tool: cargo-nextest,cargo-llvm-cov - name: Tests - run: cargo nextest run --all-features - env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" - RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" - - - name: Grcov - id: coverage - uses: actions-rs/grcov@770fa904bcbfc50da498080d1511da7388e6ddc6 # v0.1.6 + run: cargo llvm-cov nextest --lcov --output-path lcov.info --all-features - name: Upload coverage reports to Codecov uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: - files: ${{ steps.coverage.outputs.report }} + files: lcov.info flags: rust - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} build: name: Build @@ -128,10 +108,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # msys2 required by rug on windows @@ -165,12 +142,7 @@ jobs: - name: Checkout sources uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Install stable toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true + - uses: dtolnay/rust-toolchain@stable - run: cargo publish --token ${CRATES_TOKEN} env: From f57d12ab1035a95694d2f19e3f498baa5e4e7753 Mon Sep 17 00:00:00 2001 From: Skyf0l <59019720+skyf0l@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:19:22 +0200 Subject: [PATCH 2/3] fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b474f56..decedda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: tool: cargo-nextest - name: Test - run: cargo nextest run --all-features --lib --bins --test keys + run: cargo nextest run --all-features coverage: name: Coverage From 1dfeb6da78bedc79bec77a7c0422dea245533a6f Mon Sep 17 00:00:00 2001 From: Skyf0l <59019720+skyf0l@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:36:58 +0200 Subject: [PATCH 3/3] fix cov config --- codecov.yml | 7 +------ grcov.yml | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 grcov.yml diff --git a/codecov.yml b/codecov.yml index 7ecafef..f0fa780 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,9 +1,4 @@ +comment: false coverage: precision: 2 round: up - status: - project: - default: - target: 80% - threshold: 5% -comment: false diff --git a/grcov.yml b/grcov.yml deleted file mode 100644 index 7d9375a..0000000 --- a/grcov.yml +++ /dev/null @@ -1,2 +0,0 @@ -ignore: - - src/main.rs