chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.1.14 #261
Workflow file for this run
This file contains 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: test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
STABLE_PYTHON_VERSION: "3.12" | |
PYTEST_ADDOPTS: --color=yes | |
HATCH_VERBOSE: 1 | |
jobs: | |
test: | |
name: >- | |
Tests py${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
experimental: [false] | |
include: | |
- # Run tests against the next Python version, but no need for the full list of OSes. | |
os: ubuntu-latest | |
python-version: "3.13.0-alpha.0 - 3.13" | |
experimental: true | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
submodules: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Hatch | |
run: pip install --upgrade hatch | |
- name: Run tests | |
run: hatch run test | |
- name: Upload coverage | |
# TODO: Configure code coverage monitoring | |
if: false && matrix.python-version == env.STABLE_PYTHON_VERSION && matrix.os == 'ubuntu-latest' | |
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
test-conlusion: | |
name: Test matrix complete | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- run: echo "Test matrix completed successfully." | |
example: | |
name: Example | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' || ! github.event.pull_request.draft | |
services: | |
broker: | |
image: pactfoundation/pact-broker:latest@sha256:9cdd475459ee608b8ab4c32ad72e7aa9236bc5072c123fe689bdc3f44e1ea8dc | |
ports: | |
- "9292:9292" | |
env: | |
# Basic auth credentials for the Broker | |
PACT_BROKER_ALLOW_PUBLIC_READ: "true" | |
PACT_BROKER_BASIC_AUTH_USERNAME: pactbroker | |
PACT_BROKER_BASIC_AUTH_PASSWORD: pactbroker | |
# Database | |
PACT_BROKER_DATABASE_URL: sqlite:////tmp/pact_broker.sqlite | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Set up Python 3 | |
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 | |
with: | |
python-version: ${{ env.STABLE_PYTHON_VERSION }} | |
- name: Install Hatch | |
run: pip install --upgrade hatch | |
- name: Ensure broker is live | |
run: | | |
i=0 | |
until curl -sSf http://localhost:9292/diagnostic/status/heartbeat; do | |
i=$((i+1)) | |
if [ $i -gt 120 ]; then | |
echo "Broker failed to start" | |
exit 1 | |
fi | |
sleep 1 | |
done | |
- name: Examples | |
run: > | |
hatch run example --broker-url=http://pactbroker:pactbroker@localhost:9292 | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Set up Python | |
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 | |
with: | |
python-version: ${{ env.STABLE_PYTHON_VERSION }} | |
- name: Install Hatch | |
run: pip install --upgrade hatch | |
- name: Lint | |
run: hatch run lint |