Hover info and goto definition for use decls #1432
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: Rust CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
permissions: | |
contents: read | |
statuses: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-msrv: | |
name: Build with Minimum Supported Rust Version (MSRV) | |
runs-on: ubuntu-latest | |
outputs: | |
msrv: ${{ steps.extract_rust_version.outputs.msrv }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract Rust Version | |
id: extract_rust_version | |
run: | | |
rust_version=$(awk -F '"' '/rust-version/ {print $2; exit}' Cargo.toml) | |
if [ -z "$rust_version" ]; then | |
echo "Error: rust-version not found in Cargo.toml" | |
exit 1 | |
fi | |
echo "msrv=$rust_version" >> "$GITHUB_OUTPUT" | |
- name: Set Up Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ steps.extract_rust_version.outputs.msrv }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build --all | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --all | |
unit-tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test --all | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: rustup component add rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: rustup component add clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --all -- -D warnings |