Skip to content

Skip addition of trivial constraints to canonical representation of the linear relation #224

Skip addition of trivial constraints to canonical representation of the linear relation

Skip addition of trivial constraints to canonical representation of the linear relation #224

Workflow file for this run

on:
pull_request:
paths:
- '**.rs'
- 'Cargo.toml'
- 'Cargo.lock'
name: Linter and Formatter
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Check for formatting differences
id: fmt-check
run: |
if ! cargo fmt --all -- --check; then
echo "Formatting differences found"
cargo fmt --all
echo "needs_commit=true" >> $GITHUB_OUTPUT
else
echo "No formatting differences"
echo "needs_commit=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push formatting changes
if: steps.fmt-check.outputs.needs_commit == 'true'
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Apply rustfmt changes"
git push
clippy:
name: Clippy
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings