Add YAML config loading #15
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: p4p_ext | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| lint: | |
| name: Use Ruff to perform linting, formatting, and other code quality tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - run: pip install .[test] | |
| - run: | | |
| ruff check --no-fix | |
| ruff format --diff | |
| test: | |
| name: Run tests on multiple Python versions | |
| needs: | |
| - lint | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] #, mac-latest] | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install .[test] | |
| PIP_PATH=$(which pip) | |
| $PIP_PATH install .[test] | |
| - name: Run tests | |
| run: | | |
| PYTHON_PATH=$(which python) | |
| $PYTHON_PATH -m coverage run --source=. -m pytest tests/unit/ | |
| - name: Gather coverage statistics | |
| if: ${{ always() }} | |
| run: | | |
| coverage report -m | |
| 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 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed to fetch the tags | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install build tools | |
| run: >- | |
| pip install .[dist] | |
| - name: Build a binary wheel and a source tarball | |
| run: python -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ |