v7.0.2 #143
Workflow file for this run
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/CD Pipeline | |
| 'on': | |
| pull_request: | |
| push: | |
| tags: ['v*'] | |
| env: | |
| LATEST_PYTHON_VERSION: '3.14' | |
| jobs: | |
| lint: | |
| name: Lint (ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/ruff-action@v4.1.0 | |
| with: | |
| args: "check" | |
| test: | |
| name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
| python-version: ['3.12', '3.14'] | |
| defaults: | |
| run: | |
| working-directory: ${{ github.workspace }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v9.0.0 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --locked --all-extras --all-groups | |
| - name: Run tests with coverage | |
| uses: nick-fields/retry@v4 | |
| with: | |
| timeout_minutes: 2 | |
| max_attempts: 3 | |
| command: uv run --no-sync poe test-unit | |
| shell: bash | |
| - name: SonarQube Scan | |
| if: matrix.python-version == env.LATEST_PYTHON_VERSION && matrix.os == 'ubuntu-latest' | |
| uses: SonarSource/sonarqube-scan-action@v8 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v9.0.0 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ env.LATEST_PYTHON_VERSION }} | |
| run: uv python install ${{ env.LATEST_PYTHON_VERSION }} | |
| - name: Build package | |
| run: uv build | |
| - name: Smoke test (wheel) | |
| run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py | |
| - name: Smoke test (sdist) | |
| run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-packages | |
| path: dist/ | |
| retention-days: 3 | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: python-packages | |
| path: release-assets/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| name: Release ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: release-assets/* | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| environment: release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download package artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: python-packages | |
| path: dist | |
| - name: Publish to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| packages-dir: dist/ | |
| skip-existing: true | |
| verbose: true | |
| attestations: false | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| skip-existing: true | |
| verbose: true | |
| attestations: false |