Rename to IOCMimic*; various cleanups to comments; _check_pv_factory_… #285
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: p4pillon | |
| on: | |
| push: | |
| branches-ignore: | |
| - "documentation" | |
| tags: | |
| - '**' | |
| pull_request: | |
| branches-ignore: | |
| - "documentation" | |
| tags: | |
| - '**' | |
| workflow_dispatch: | |
| # Allow manual triggering of workflow | |
| jobs: | |
| lint: | |
| name: Use Ruff to perform linting, formatting, and other code quality tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v3 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - run: uv sync --group test | |
| - run: | | |
| uv run ruff check --no-fix | |
| uv run ruff format --diff | |
| test: | |
| name: Run tests on multiple Python versions | |
| needs: | |
| - lint | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] #, mac-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --group test --python ${{ matrix.python-version }} | |
| - name: Run tests | |
| run: uv run coverage run -m pytest | |
| - name: Gather coverage statistics | |
| if: ${{ always() }} | |
| run: | | |
| uv run coverage report -m | |
| uv run coverage xml | |
| - name: Upload pytest test results | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-results-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: coverage.xml | |
| # Use always() to always run this step to publish test results when there are test failures | |
| build: | |
| name: Build distribution 📦 | |
| needs: | |
| - test | |
| #if: github.ref == 'refs/heads/main' # Only build dist on main | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed to fetch the tags | |
| - uses: astral-sh/setup-uv@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install build tools | |
| run: uv sync --group dist | |
| - name: Build a binary wheel and a source tarball | |
| run: uv run python -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: >- | |
| Publish Python 🐍 distribution 📦 to PyPI | |
| if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/p4pillon | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| publish-to-testpypi: | |
| name: Publish Python 🐍 distribution 📦 to TestPyPI | |
| if: startsWith(github.ref, 'refs/tags/test') # only publish to PyPI on tag pushes prefixed test | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/p4pillon | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution 📦 to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |