chore(deps): update sonarsource/sonarqube-scan-action action to v8 #377
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: Unit Test CI | |
| permissions: | |
| contents: read | |
| packages: read | |
| actions: read | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - v* | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - review_requested | |
| - assigned | |
| push: | |
| branches: | |
| - main | |
| - v* | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - ".github/workflows/unit_test.yml" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout commit | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run ruff check | |
| run: uv run ruff check . | |
| - name: Run ruff format check | |
| run: uv run ruff format --check . | |
| pytest: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.13"] | |
| steps: | |
| - name: Checkout commit | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 # sonarcloud needs full git histories | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run pytest with coverage | |
| run: | | |
| mkdir -p test_result | |
| uv run coverage run -m pytest --junit-xml=test_result/pytest.xml | |
| uv run coverage xml -o test_result/coverage.xml | |
| - name: Generate coverage report | |
| run: uv run coverage report -m | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |