name: CI on: push: branches: [ "master" ] paths: - '**' - '!**.md' pull_request: paths: - '**' - '!**.md' env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full jobs: # Build and test with default features build-and-test: runs-on: ubuntu-latest env: RUSTFLAGS: --deny warnings steps: - uses: actions/checkout@v4 - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev - name: Rustup update run: rustup update - name: Show cargo version run: cargo --version - name: Rust build caching uses: Swatinem/rust-cache@v2 with: workspaces: . -> target key: default-features save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build run: cargo check --verbose --locked - name: Test run: cargo test --all --verbose --locked - name: Check dirty git uses: cbeck88/check-dirty-git@v1 # Build and test with no default features build-and-test-no-default-features: runs-on: ubuntu-latest env: RUSTFLAGS: --deny warnings steps: - uses: actions/checkout@v4 - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev - name: Rustup update run: rustup update - name: Show cargo version run: cargo --version - name: Rust build caching uses: Swatinem/rust-cache@v2 with: workspaces: . -> target key: no-default-features save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build run: cargo check --no-default-features --verbose --locked - name: Test run: cargo test --no-default-features --verbose --locked - name: Check dirty git uses: cbeck88/check-dirty-git@v1 # Build and test with all features build-and-test-all-features: runs-on: ubuntu-latest env: RUSTFLAGS: --deny warnings steps: - uses: actions/checkout@v4 - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev - name: Rustup update run: rustup update - name: Show cargo version run: cargo --version - name: Rust build caching uses: Swatinem/rust-cache@v2 with: workspaces: . -> target key: all-features save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build run: cargo check --all-features --verbose --locked - name: Test run: cargo test --all-features --verbose --locked - name: Check dirty git uses: cbeck88/check-dirty-git@v1 # Linting and formatting lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev - name: Rustup update and install nightly run: | rustup update rustup install nightly rustup component add rustfmt --toolchain nightly - name: Show cargo version run: cargo --version - name: Rust build caching uses: Swatinem/rust-cache@v2 with: key: lint workspaces: . -> target save-if: ${{ github.ref == 'refs/heads/master' }} - name: Format run: cargo +nightly fmt -- --check - name: Clippy run: cargo clippy --all --all-features -- -D warnings # Semver compatibility checks # Use git baseline since crates aren't published to crates.io yet # See: https://github.com/obi1kenobi/cargo-semver-checks?tab=readme-ov-file#does-the-crate-im-checking-have-to-be-published-on-cratesio semver-checks: runs-on: ubuntu-latest # Only run on PRs (compare PR head against base branch) if: github.event_name == 'pull_request' steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Check semver uses: obi1kenobi/cargo-semver-checks-action@v2 with: baseline-rev: ${{ github.event.pull_request.base.sha }}