-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
140 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Test and Build Rust | ||
|
||
on: | ||
push: | ||
# Enable when testing release infrastructure on a branch. | ||
branches: | ||
- build | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
publish: | ||
name: Publish to crates.io | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
env: | ||
RUSTFLAGS: --allow unknown-lints --deny warnings | ||
steps: | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
- uses: actions/checkout@v4 | ||
- uses: katyo/publish-crates@v2 | ||
with: | ||
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
dry-run: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Test and Build Rust | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo fmt --check --verbose | ||
|
||
clippy: | ||
name: Clippy ${{ matrix.toolchain }} | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ (matrix.toolchain == 'beta') || (matrix.toolchain == 'nightly') }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
env: | ||
RUSTFLAGS: --deny warnings | ||
steps: | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo fetch --locked | ||
- run: cargo clippy --offline --all-features --all-targets | ||
- run: cargo doc --offline --all-features --no-deps | ||
|
||
features: | ||
name: Features ${{ matrix.toolchain }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: | ||
- stable | ||
- beta | ||
- 1.38 # MSRV: minimum supported Rust version | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
env: | ||
RUSTFLAGS: --allow unknown-lints --deny warnings | ||
steps: | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install cargo-hack | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-hack | ||
|
||
- uses: actions/checkout@v4 | ||
- run: cargo fetch --locked | ||
|
||
- name: Check all targets | ||
run: cargo hack --keep-going --feature-powerset check --all-targets --offline | ||
|
||
- name: Check without dev dependencies | ||
run: cargo hack --keep-going --feature-powerset --no-dev-deps check --offline | ||
|
||
test: | ||
name: Test ${{ matrix.toolchain }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.toolchain == 'nightly' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
- 1.38 # MSRV: minimum supported Rust version | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
env: | ||
RUSTFLAGS: --allow unknown-lints --deny warnings | ||
steps: | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo fetch --locked | ||
- run: cargo build --offline --all-features --all-targets | ||
- run: cargo test --offline --all-features |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters