Merge pull request #75 from cadifyai/74-replace-use-of-gpt-with-tool #202
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: Check Code | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# required by sticky-pull-request-comment | |
permissions: | |
pull-requests: write | |
jobs: | |
isort: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install isort | |
run: python -m pip install isort | |
- name: Run isort check | |
run: isort . --check | |
pyright: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install pyright | |
run: python -m pip install pyright | |
- name: Run pyright | |
run: pyright | |
coverage: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
runs-on: "ubuntu-latest" | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
#---------------------------------------------- | |
# --------- install dependencies --------- | |
#---------------------------------------------- | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# add matrix specifics and run test suite | |
#---------------------------------------------- | |
- name: Run tests | |
run: | | |
poetry run coverage run -m pytest tests/ | |
poetry run coverage xml | |
#---------------------------------------------- | |
# create coverage summary | |
#---------------------------------------------- | |
- name: Code Coverage Summary Report | |
uses: irongut/CodeCoverageSummary@v1.3.0 | |
with: | |
filename: coverage.xml | |
format: markdown | |
output: both # console and .md file | |
badge: true | |
fail_below_min: true | |
thresholds: '90 95' | |
#---------------------------------------------- | |
# write job summary | |
#---------------------------------------------- | |
- name: Write job summary | |
run: | | |
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY |