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

.github: replace actions-rs with dtolnay/rust-toolchain, add caching #38

Merged
merged 4 commits into from
Nov 22, 2023
Merged
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
56 changes: 17 additions & 39 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,14 @@ jobs:
rust: [stable]
profile: [dev, release]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- if: ${{ matrix.profile == 'dev' }}
name: Build & test dev
run: |
cargo build
cargo build --all-features
cargo test
# We need to duplicate the logic here, because up to 1.56 Cargo
# considers the --profile option unstable. Once our minimum
# supported Rust version is above that, we should remove the above
# block.
- if: ${{ matrix.rust == 'stable' && matrix.profile != 'dev'}}
name: Build & test release
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.profile }}
d-e-s-o marked this conversation as resolved.
Show resolved Hide resolved
- name: Build & test
run: |
cargo build --profile=${{ matrix.profile }}
cargo build --all-features --profile=${{ matrix.profile }}
Expand All @@ -48,55 +38,43 @@ jobs:
name: Build using minimum versions of dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Nightly Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly -Z minimal-versions update
- name: Install minimum Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
# Please adjust README and rust-version field in Cargo.toml files when
# bumping version.
toolchain: 1.56
default: true
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --locked --all-features
rustfmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt
override: true
- run: cargo +nightly fmt -- --check
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --no-deps --all-targets --all-features -- -A unknown_lints -D warnings
rustdoc:
name: Generate documentation
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: '-D warnings -D rustdoc::broken_intra_doc_links'
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps