Update CI configuration for Rust workflow #745
This file contains hidden or 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: CI / Linton:push:paths:- '.py' | ||
| - '.github/workflows/lint.yml' | ||
| pull_request: | ||
| paths: | ||
| - '.py'- '.github/workflows/lint.yml'Added workflow_dispatch for manual triggeringworkflow_dispatch:jobs:lint:# Upgraded to ubuntu-latest which tracks the newest stable Ubuntu runnerruns-on: ubuntu-latest# Use a matrix to test across multiple Python versions | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
| steps: | ||
| - name: Checkout code | ||
| # Upgraded checkout action to v4 | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| # Upgraded setup-python action to v5 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| # Enable caching for pip to speed up workflow runs | ||
| cache: 'pip' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| # Added black for formatting checks alongside flake8 | ||
| pip install flake8 black | ||
| - name: Lint with flake8 | ||
| run: | | ||
| # stop the build if there are Python syntax errors or undefined names | ||
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
| - name: Check formatting with black | ||
| run: | | ||
| # Check if the code is formatted with black. | ||
| # Fails the build if it's not formatted correctly. | ||
| black --check . | ||