name: CI on: pull_request: branches: [ "main", "dev" ] push: branches: [ "main", "dev" ] permissions: contents: read # Cancel previous runs if a new one is triggered concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: lint: name: Code Linting runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Checkout repository uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v6.3.0 with: python-version: "3.11" cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip pip install ruff - name: Run Ruff linter run: ruff check . --output-format=github - name: Run Ruff formatter check run: ruff format . --check - name: Show statistics run: ruff check . --statistics - name: Generate lint report if: always() run: | ruff check . --output-format=json > ruff-report.json || true - name: Upload lint report uses: actions/upload-artifact@v7.0.1 if: always() with: name: lint-report path: ruff-report.json retention-days: 30