| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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@v6
- with:
- fetch-depth: 0
- - name: Set up Python
- uses: actions/setup-python@v5
- 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@v4
- if: always()
- with:
- name: lint-report
- path: ruff-report.json
- retention-days: 30
|