Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: better CI #1

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 18 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches: [main]
tags: ["*"]
tags: ['v*']
pull_request:
branches: [main]

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -72,13 +64,11 @@ 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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
comment: false
coverage:
precision: 2
round: up
status:
project:
default:
target: 80%
threshold: 5%
comment: false
2 changes: 0 additions & 2 deletions grcov.yml

This file was deleted.