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

ci: replace unmaintained action-rs #166

Merged
merged 4 commits into from
Dec 5, 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
70 changes: 11 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,19 @@ jobs:
name: Tests pass
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Get Cargo version
id: cargo_version
run: echo "::set-output name=version::$(cargo -V | tr -d ' ')"
shell: bash

- name: Download cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}-${{ hashFiles('Cargo.toml') }}
restore-keys: ${{ runner.os }}-${{ steps.cargo_version.outputs.version }}

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --features=serde --verbose
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --verbose
- run: cargo test --features=serde --verbose

clippy:
name: No warnings from Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
components: clippy

- name: Check Clippy lints
env:
RUSTFLAGS: -D warnings
Expand All @@ -64,38 +36,18 @@ jobs:
name: Source code is formatted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
components: rustfmt

- name: Check formatting
run: cargo fmt --all -- --check
- run: cargo fmt --all -- --check

check_documentation:
name: Documentation builds successfully
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal

- name: Download cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: documentation

- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
Expand Down