CI #3972
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: CI | |
on: | |
push: | |
branches: ['master'] | |
tags: ['v*'] | |
pull_request: | |
branches: ['master'] | |
schedule: | |
# Every hour | |
- cron: '0 * * * *' | |
jobs: | |
lint: | |
name: Run lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-20.04'] | |
python: ['3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- name: Checkout source repository for Python ${{ matrix.python }} | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Run lint on Python ${{ matrix.python }} | |
run: make lint | |
test: | |
name: Run tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
etcd: ['3.3.27', '3.4.23', '3.5.7'] | |
os: ['ubuntu-20.04'] | |
python: ['3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- name: Checkout source repository for Python ${{ matrix.python }} | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Set up etcd ${{ matrix.etcd }} | |
run: | | |
pushd /tmp | |
wget https://github.com/etcd-io/etcd/releases/download/v${{ matrix.etcd }}/etcd-v${{ matrix.etcd }}-linux-amd64.tar.gz -O - | tar -xz | |
sudo cp etcd-v${{ matrix.etcd }}-linux-amd64/etcd* /usr/bin | |
popd | |
- name: Set up dependencies for Python ${{ matrix.python_version }} | |
run: make bootstrap | |
- name: Run tests on Python ${{ matrix.python }} | |
timeout-minutes: 10 | |
run: make testcluster | |
- name: Run genproto | |
run: | | |
make genproto | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v2 | |
if: matrix.python == '3.9' && github.ref == 'refs/heads/master' | |
distrib: | |
name: Build and upload the packages | |
needs: [lint, test] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-20.04'] | |
python: ['3.9'] | |
steps: | |
- name: Checkout source repository for Python ${{ matrix.python }} | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build the packages | |
run: make build | |
- name: Upload built packages to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |