diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/ack.yml | 9 | ||||
-rw-r--r-- | .github/workflows/push.yml | 12 | ||||
-rw-r--r-- | .github/workflows/release.yml | 48 | ||||
-rw-r--r-- | .github/workflows/tox.yml | 76 |
4 files changed, 145 insertions, 0 deletions
diff --git a/.github/workflows/ack.yml b/.github/workflows/ack.yml new file mode 100644 index 0000000..5880add --- /dev/null +++ b/.github/workflows/ack.yml @@ -0,0 +1,9 @@ +# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml +name: ack +on: + pull_request_target: + types: [opened, labeled, unlabeled, synchronize] + +jobs: + ack: + uses: ansible-community/devtools/.github/workflows/ack.yml@main diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..e8239f7 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,12 @@ +# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/push.yml +name: push +on: + push: + branches: + - main + - 'releases/**' + - 'stable/**' + +jobs: + ack: + uses: ansible-community/devtools/.github/workflows/push.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d63d5b6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: release + +on: + release: + types: [published] + +jobs: + pypi: + name: Publish to PyPI registry + environment: release + runs-on: ubuntu-20.04 + + env: + FORCE_COLOR: 1 + PY_COLORS: 1 + TOXENV: packaging + TOX_PARALLEL_NO_SPINNER: 1 + + steps: + - name: Switch to using Python 3.8 by default + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install tox + run: >- + python3 -m + pip install + --user + tox + - name: Check out src from Git + uses: actions/checkout@v2 + with: + fetch-depth: 0 # needed by setuptools-scm + - name: Build dists + run: python -m tox + - name: Publish to test.pypi.org + if: >- # "create" workflows run separately from "push" & "pull_request" + github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.testpypi_password }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish to pypi.org + if: >- # "create" workflows run separately from "push" & "pull_request" + github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..683ad46 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,76 @@ +name: gh + +on: + pull_request: +jobs: + gh: + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - name: linters + python-version: 3.6 + # - name: docs + # python-version: 3.6 + # continue-on-error: true + - name: packaging + python-version: 3.6 + - name: py36 + python-version: 3.6 + - name: py37 + python-version: 3.7 + - name: py38 + python-version: 3.8 + - name: py39 + python-version: 3.9 + - name: py310 + python-version: "3.10" + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # needed by setuptools-scm + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: >- + Log the currently selected Python + version info (${{ matrix.python-version }}) + run: | + python --version --version + which python + - name: Pip cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ env.PY_SHA256 }}-${{ hashFiles('setup.cfg', 'tox.ini', 'pyproject.toml', '.pre-commit-config.yaml', 'pytest.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install tox + run: | + python3 -m pip install --upgrade tox + - name: Log installed dists + run: >- + python3 -m pip freeze --all + - name: "Test with tox" + run: | + python3 -m tox + env: + TOXENV: ${{ matrix.name }} + - name: Archive logs + uses: actions/upload-artifact@v2 + with: + name: logs.zip + path: .tox/**/log/ + check: + needs: + - gh + runs-on: ubuntu-latest + steps: + - name: Report success of the test matrix + run: >- + print("All's good") + shell: python |