chore: fix foo refs in doctests #16
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
name: CI | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
CI: 1 | |
jobs: | |
clippy: | |
name: Clippy validation${{ matrix.all-features && ' with all features' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
all-features: [ false, true ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust with clippy | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Output Rust toolchain info | |
run: | | |
cargo --version --verbose | |
rustc --version | |
cargo clippy --version | |
- name: Run clippy | |
uses: clechasseur/rs-clippy-check@v3 | |
with: | |
args: --workspace --all-targets ${{ matrix.all-features && '--all-features' || '' }} -- -D warnings | |
fmt: | |
name: Rustfmt check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly with rustfmt | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: Output Rust toolchain info | |
run: | | |
cargo +nightly --version --verbose | |
rustc +nightly --version | |
cargo +nightly fmt --version | |
- name: Run Rustfmt | |
uses: clechasseur/rs-fmt-check@v2 | |
with: | |
args: --all | |
build-msrv: | |
name: MSRV build for Rust ${{ matrix.toolchain }} on ${{ matrix.os }}${{ matrix.all-features && ' with all features' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ 1.56.1 ] | |
os: [ ubuntu, macos, windows ] | |
all-features: [ false, true ] | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain ${{ matrix.toolchain }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Output Rust toolchain info | |
run: | | |
cargo --version --verbose | |
rustc --version | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: v1-rust | |
key: all-features-${{ matrix.all-features }}-msrv-cargo-files-${{ hashFiles('**/Cargo.*.msrv') }} | |
- name: Check if we need to install MSRV cargo files | |
id: check_msrv_cargo_files | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: "Cargo.lock.msrv, Cargo.toml.msrv" | |
- name: Install MSRV cargo files | |
if: ${{ steps.check_msrv_cargo_files.outputs.files_exists == 'true' }} | |
run: just pre-msrv | |
- name: Run checks | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: check | |
args: --workspace --lib --bins ${{ matrix.all-features && '--all-features' || '' }} | |
build: | |
name: Build for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }} on ${{ matrix.os }}${{ matrix.ignore-lock && ' without Cargo.lock' || '' }}${{ matrix.all-features && ' with all features' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ 1.56.1, stable, beta, nightly ] | |
os: [ ubuntu, macos, windows ] | |
ignore-lock: [ false, true ] | |
all-features: [ false, true ] | |
include: | |
- experimental: false | |
- toolchain: beta | |
experimental: true | |
- toolchain: nightly | |
experimental: true | |
runs-on: ${{ matrix.os }}-latest | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Remove Cargo.lock | |
if: ${{ matrix.ignore-lock }} | |
run: rm Cargo.lock | |
- name: Install Rust toolchain ${{ matrix.toolchain }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Output Rust toolchain info | |
run: | | |
cargo --version --verbose | |
rustc --version | |
- name: Rust Cache | |
if: ${{ !matrix.experimental }} | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: v1-rust | |
key: ignore-lock-${{ matrix.ignore-lock }}-all-features-${{ matrix.all-features }} | |
- name: Run checks | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: check | |
args: --workspace --all-targets ${{ matrix.all-features && '--all-features' || '' }} | |
- name: Run tests | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: test | |
args: --workspace ${{ matrix.all-features && '--all-features' || '' }} | |
tarpaulin: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-tarpaulin | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-tarpaulin | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-targets: false | |
- name: Run cargo-tarpaulin | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: tarpaulin | |
- name: Upload code coverage results to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: | | |
cobertura.xml | |
tarpaulin-report.html | |
doc: | |
name: Rustdoc check for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ stable, nightly ] | |
include: | |
- experimental: false | |
- toolchain: nightly | |
experimental: true | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain ${{ matrix.toolchain }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Rust Cache | |
if: ${{ !matrix.experimental }} | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-targets: false | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Generate doc using rustdoc | |
run: just doc | |
doc-coverage: | |
name: Rustdoc coverage check | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Check doc coverage | |
run: just doc-coverage | |
publish-dry-run: | |
name: Publish dry-run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-targets: false | |
- name: Perform publish dry-run | |
run: just test-package |