Skip to content

Commit

Permalink
Merge pull request #38 from tamird/actions
Browse files Browse the repository at this point in the history
.github: replace actions-rs with dtolnay/rust-toolchain, add caching
  • Loading branch information
d-e-s-o authored Nov 22, 2023
2 parents 858ad05 + 64e01b9 commit e30969a
Showing 1 changed file with 17 additions and 39 deletions.
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 }}
- 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

0 comments on commit e30969a

Please sign in to comment.