Skip to content

Commit

Permalink
Add min versions checks to CI (#75)
Browse files Browse the repository at this point in the history
* Add min versions check to CI
* Add coverage report archiving
  • Loading branch information
Finomnis authored Nov 22, 2023
1 parent c817731 commit a49a7c6
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
67 changes: 62 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall

- name: Install cargo-msrv
uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
run: cargo binstall --version 0.16.0-beta.17 --no-confirm cargo-msrv

#- uses: Swatinem/rust-cache@v1

- name: Check MSRV
run: cargo msrv verify
run: cargo msrv verify --log-target=stdout --output-format=json

semver:
name: Semantic Versioning
Expand All @@ -80,6 +81,62 @@ jobs:
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2

min-versions:
name: Minimal Dependency Versions
runs-on: ubuntu-latest
needs: [lints, docs]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions

- name: Check with minimal versions
run: cargo minimal-versions check --workspace --ignore-private

- name: Test with minimal versions
run: cargo minimal-versions test -- --test-threads 1

min-versions-msrv:
name: Minimal Depencency Versions (MSRV)
runs-on: ubuntu-latest
needs: [lints, docs]
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-msrv
run: cargo binstall --version 0.16.0-beta.17 --no-confirm cargo-msrv
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions

- name: Determine MSRV
run: echo "MSRV=$(cargo msrv show --output-format=minimal)" >> $GITHUB_ENV

- name: Show MSRV
run: echo $MSRV

- name: Install MSRV Rust version
run: rustup toolchain install $MSRV

- name: Check with minimal versions
run: cargo +$MSRV minimal-versions check --workspace --ignore-private

lints:
name: Lints
runs-on: ubuntu-latest
Expand Down Expand Up @@ -148,7 +205,7 @@ jobs:
runs-on: ubuntu-latest
environment: production
if: github.event_name == 'release'
needs: [build, test, msrv, lints, docs, leaks, semver]
needs: [build, test, msrv, lints, docs, leaks, semver, min-versions, min-versions-msrv]
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ jobs:
with:
files: codecov.json
fail_ci_if_error: true
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: codecov.json
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ tokio-util = { version = "0.7.10", default-features = false, features = ["rt"] }
bytes = "1.5.0"
http-body-util = "0.1.0"

futures-util = "0.3.16" # Required to fix minimal-versions
tower = "0.4.1" # Required to fix minimal-versions

# Warp example
warp = "0.3.1"
warp = "0.3.6"
headers = "0.3.5" # Required to fix minimal-versions
serde_urlencoded = "0.7.1" # Required to fix minimal-versions

# For testing unix signals
[target.'cfg(unix)'.dev-dependencies]
Expand Down

0 comments on commit a49a7c6

Please sign in to comment.