Merge pull request #1 from mattmezza/looop #5
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: Python Client CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'clients/python/**' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'clients/python/**' | |
| jobs: | |
| test: | |
| name: Test Python Client (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: pip-${{ matrix.python-version }}-${{ hashFiles('clients/python/pyproject.toml') }} | |
| restore-keys: | | |
| pip-${{ matrix.python-version }}- | |
| - name: Install package with dev dependencies | |
| working-directory: clients/python | |
| run: pip install -e ".[dev]" | |
| - name: Run tests | |
| working-directory: clients/python | |
| run: pytest tests/ -v | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/python-v') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Build package | |
| working-directory: clients/python | |
| run: python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: clients/python/dist/ |