add a bunch of features #35
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: Python CI | |
on: | |
pull_request: | |
branches: ["main", "release-*"] | |
jobs: | |
code-health: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install black ruff | |
- name: Run black checks | |
uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
src: "sdks/python" | |
version: "~= 23.0" | |
checkName: "test_and_lint" # NOTE: this needs to be the same as the job name | |
- name: Run ruff checks | |
uses: chartboost/ruff-action@v1 | |
with: | |
src: "sdks/python" | |
version: 0.0.265 | |
checkName: "test_and_lint" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
pytest: | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
cd sdks/python | |
pip install poetry | |
poetry install --all-extras | |
- name: Generate Report | |
run: | | |
cd sdks/python | |
poetry run coverage run -m pytest | |
coverage xml -o coverage.xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: sdks/python/coverage.xml | |
name: python-${{ matrix.python-version }} |