Fix GitHub Actions badge #20
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: Tests | |
on: | |
push: | |
branches: [ master ] | |
tags: [ '*.*.*' ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [3.6, 3.7, 3.8, 3.9] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.15.3' | |
- name: Installation | |
run: | | |
go env -w GO111MODULE=on | |
go get mvdan.cc/sh/v3/cmd/shfmt | |
pip install "poetry==1.1.4" | |
poetry config virtualenvs.create false | |
poetry install --no-interaction --no-ansi | |
- name: Linters | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.6' | |
run: | | |
pre-commit run -a | |
- name: Show versions | |
run: | | |
shfmt --version | |
docker --version || echo "Docker 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@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: 3.7 | |
- name: Install Poetry | |
run: | | |
pip install "poetry==1.1.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 }} |