Add Podman fallback (#9) #9
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: Tests | |
on: | |
push: | |
branches: [ master ] | |
tags: [ '[0-9]+.[0-9]+.[0-9]+*' ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '^1.22.0' | |
- name: Installation | |
run: | | |
go install mvdan.cc/sh/v3/cmd/shfmt@latest | |
pip install "poetry==1.8.4" | |
poetry config virtualenvs.create false | |
poetry install --no-interaction --no-ansi | |
- name: Linters | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' | |
run: | | |
pre-commit run --all-files | |
- name: Show shfmt version | |
run: | | |
shfmt --version | |
- name: Show more versions on non-Windows | |
if: matrix.os != 'windows-latest' | |
run: | | |
docker --version || echo "Docker not installed" | |
podman --version || echo "Podman not installed" | |
- name: Test with pytest | |
run: | | |
pytest | |
pypi-publish: | |
# Only publish if all other jobs succeed | |
needs: | |
- build | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Poetry | |
run: | | |
pip install "poetry==1.8.4" | |
- name: Build and publish | |
run: | | |
# TODO: Remove the first command as soon as this Poetry bug is fixed: https://github.com/python-poetry/poetry/issues/2210 | |
poetry config http-basic.pypi "__token__" "${POETRY_PYPI_TOKEN_PYPI}" | |
poetry build | |
poetry publish | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} |