Skip to content

Update doc links (#132) #656

Update doc links (#132)

Update doc links (#132) #656

Workflow file for this run

name: Rust CI
on:
push:
branches: ["main"]
pull_request:
env:
push_main: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Uninstall pre-installed tools
run: |
rm -f ~/.cargo/bin/rust-analyzer
rm -f ~/.cargo/bin/rustfmt
rm -f ~/.cargo/bin/cargo-fmt
- name: Update Rust toolchain and components
run: |
rustup update
rustup component add rustfmt
rustup component add clippy
- name: Build
run: RUSTFLAGS=-Dwarnings cargo build --all-features --all-targets --verbose
- name: Verify target directory exists
run: |
echo "Checking if target directory exists and is not empty"
ls -la target
- name: Run tests
run: cargo test --verbose
- name: Run Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets
- name: Check format
run: cargo fmt -- --check
- name: Build and test documentation
run: cargo doc --no-deps --verbose
- name: Cache Cargo registry
if: ${{ env.push_main == 'true' }}
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
if: ${{ env.push_main == 'true' }}
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-