name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
actions: read
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
container: ghcr.io/loonghao/rust-toolkit:base
steps:
- uses: actions/checkout@v4
- name: Check Rust version
run: |
echo "๐ฆ Checking Rust version for malachite compatibility..."
rustc --version
echo "๐ฆ Cargo version:"
cargo --version
shell: bash
- name: Check formatting
shell: bash
run: |
echo "๐จ Checking code formatting..."
cargo fmt --all --check
- name: Run clippy
shell: bash
run: |
echo "๐ Running clippy lints..."
cargo clippy --all-targets --all-features -- -D warnings -A clippy::too_many_lines -A clippy::uninlined_format_args -A clippy::format_push_string
- name: Check documentation
shell: bash
env:
RUSTDOCFLAGS: -D warnings
run: |
echo "๐ Checking documentation..."
cargo doc --no-deps --document-private-items --workspace
- name: Run tests
shell: bash
run: |
echo "๐งช Running tests..."
cargo test --verbose --workspace