.github/workflows/ci.yaml #7
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
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
static: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- 3.9 | |
- 2.7 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: run tox | |
run: tox | |
env: | |
TOXENV: py${{ matrix.python-version }}-static | |
examples: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- 3.9 | |
- 2.7 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: start rabbitmq | |
run: | | |
docker run -d --rm -p 15672:15672 -p 5672:5672 -p 5671:5671 --name nameko-rabbitmq ghcr.io/nameko/nameko-rabbitmq:3.6.6 | |
docker cp nameko-rabbitmq:/srv/ssl certs | |
- name: install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: run tox | |
run: tox | |
env: | |
TOXENV: py${{ matrix.python-version }}-examples | |
test: | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
python-version: | |
- "3.11" | |
- "3.10" | |
- 3.9 | |
- 3.8 | |
- 3.7 | |
- 2.7 | |
dependency-set: | |
- pinned | |
- latest | |
- oldest | |
- extra | |
command: | |
- test | |
experimental: | |
- false | |
# disable experimental builds until github actions has a good way to | |
# allow failure for a job but not fail the workflow | |
# see https://github.com/actions/toolkit/issues/399. | |
# include: | |
# - python-version: 3.6 | |
# dependency-set: latest | |
# command: test-mastereventlet | |
# experimental: true | |
# - python-version: 3.6 | |
# dependency-set: latest | |
# command: test-branchcoverage | |
# experimental: true | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: start rabbitmq | |
run: | | |
docker run -d --rm -p 15672:15672 -p 5672:5672 -p 5671:5671 --name nameko-rabbitmq ghcr.io/nameko/nameko-rabbitmq:3.6.6 | |
docker cp nameko-rabbitmq:/srv/ssl certs | |
- name: install toxiproxy | |
run: | | |
mkdir $PWD/bin | |
wget -O $PWD/bin/toxiproxy-server https://github.com/Shopify/toxiproxy/releases/download/v2.0.0/toxiproxy-server-linux-amd64 | |
chmod +x $PWD/bin/toxiproxy-server | |
sudo ln -s $PWD/bin/toxiproxy-server /usr/local/bin/toxiproxy-server | |
- name: install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: run tox | |
run: tox | |
env: | |
TOXENV: py${{ matrix.python-version }}-${{ matrix.dependency-set }}-${{ matrix.command }} | |
docs: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.6 | |
- name: install libenchant | |
run: | | |
sudo apt-get install -y libenchant-dev | |
- name: install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: run tox | |
run: tox | |
env: | |
TOXENV: docs | |
distribute: | |
runs-on: ubuntu-latest | |
needs: | |
- static | |
- examples | |
- test | |
- docs | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: generate distributables | |
run: | | |
pip install wheel | |
python setup.py sdist bdist_wheel | |
- name: publish to pypi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |