Skip to content

Commit

Permalink
build: deduplicate MSRV definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed May 12, 2024
1 parent 9c44920 commit 2730da5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -16,13 +16,19 @@ concurrency:
cancel-in-progress: true

jobs:
read_msrv:
name: Read MSRV
uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@main

test:
runs-on: ubuntu-latest
needs: read_msrv

strategy:
fail-fast: false
matrix:
toolchain:
- { name: msrv, version: "1.67" }
- { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" }
- { name: stable, version: stable }

name: Test / ${{ matrix.toolchain.name }}
Expand All @@ -34,7 +40,7 @@ jobs:
with:
toolchain: ${{ matrix.toolchain.version }}

- name: Install just & nextest
- name: Install just, nextest
uses: taiki-e/install-action@v2.33.12
with:
tool: just,nextest
Expand Down
10 changes: 8 additions & 2 deletions justfile
Expand Up @@ -7,6 +7,13 @@ clippy:
cargo clippy --workspace --no-default-features --all-features
cargo hack --feature-powerset --depth=3 clippy --workspace

msrv := ```
cargo metadata --format-version=1 \
| jq -r 'first(.packages[] | select(.source == null and .name == "actix-tls")) | .rust_version' \
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/'
```
msrv_rustup := "+" + msrv
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private]
downgrade-msrv:
Expand All @@ -15,8 +22,7 @@ downgrade-msrv:
cargo update -p=trybuild --precise=1.0.90
# Test workspace using MSRV
test-msrv: downgrade-msrv
@just test-no-coverage +1.67.0
test-msrv: downgrade-msrv (test-no-coverage msrv_rustup)
# Test workspace without generating coverage files
[private]
Expand Down

0 comments on commit 2730da5

Please sign in to comment.