v0.9.0 #91
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: Python CI/CD | |
| on: | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - "**/*.py" | |
| release: | |
| types: [published] | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' && github.base_ref == 'master' | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Cache uv environment | |
| uses: actions/cache@v3 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - name: Sync dependencies | |
| run: uv sync --extra evaluation | |
| - name: Create .env file for testing | |
| run: | | |
| echo "API_KEY=${{ secrets.ARTIFEX_API_KEY }}" > .env | |
| - name: Run Unit Tests | |
| run: uv run pytest tests/unit -x -v --tb=short | |
| - name: Run Integration Tests | |
| run: uv run pytest tests/integration -x -v --tb=short | |
| publish: | |
| name: Build and Publish to PyPI | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build the package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: python -m twine upload dist/* |