fix: nested foreach
#3453
This file contains hidden or 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: Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "keep/**" | |
- "tests/**" | |
pull_request: | |
paths: | |
- "keep/**" | |
- "tests/**" | |
workflow_dispatch: | |
permissions: | |
actions: write | |
concurrency: | |
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
env: | |
PYTHON_VERSION: 3.11 | |
SQLALCHEMY_WARN_20: 1 | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: chartboost/ruff-action@v1 | |
with: | |
src: "./keep" | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: cache deps | |
id: cache-deps | |
uses: actions/[email protected] | |
with: | |
path: .venv | |
key: pydeps-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies using poetry | |
run: poetry install --no-interaction --no-root --with dev | |
- name: Run unit tests and report coverage | |
run: | | |
poetry run coverage run --omit="*/test*" --branch -m pytest --timeout 20 -n auto --non-integration --ignore=tests/e2e_tests/ | |
- name: Convert coverage results to JSON | |
run: poetry run coverage json --omit="keep/providers/*" | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
files: coverage.json | |
verbose: true |