CI #1758
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: | |
- cron: 0 4 * * * | |
jobs: | |
test: | |
name: Run client tests | |
strategy: | |
matrix: | |
py_version: ['3.9', '3.10', '3.11', '3.12'] | |
os: [ubuntu, macos, windows] | |
exclude: | |
- py_version: '3.10' | |
os: macos | |
- py_version: '3.10' | |
os: windows | |
- py_version: '3.11' | |
os: macos | |
- py_version: '3.11' | |
os: ubuntu | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@v4 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.py_version }} | |
- name: Cache packages | |
uses: actions/cache@v4.2.0 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-py-${{ matrix.py_version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('setup.py') }} | |
- name: Install dependencies | |
uses: py-actions/py-dependency-install@v4 | |
with: | |
path: requirements.txt | |
- name: Lint | |
run: | | |
echo "::add-matcher::.github/actionlint-matcher.json" | |
make lint | |
env: | |
CI_LINT_RUN: 1 | |
- name: Run tests | |
run: make test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5.3.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: .coverage.xml | |
name: client-codecov | |
flags: py${{ matrix.py_version }} | |
all-tests-passed: | |
name: All tests passed | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dummy | |
run: | | |
echo "OK" | |
release: | |
name: Release client | |
runs-on: ubuntu-latest | |
needs: | |
- all-tests-passed | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install twine build | |
- name: Make dist | |
run: | | |
python -m build | |
- name: PyPI upload | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
TWINE_NON_INTERACTIVE: 1 | |
run: | | |
twine upload dist/* |