Skip to content

Update config

Update config #5

Workflow file for this run

name: Python Tests and Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry install
- name: Run tests with pytest and coverage
run: |
poetry run pytest --cov=mind_renderer --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
- name: Check coverage threshold
run: |
coverage_percentage=$(poetry run coverage report | grep TOTAL | awk '{print $4}' | sed 's/%//')
if (( $(echo "$coverage_percentage < 80" | bc -l) )); then
echo "Coverage is below 80%. Current coverage: $coverage_percentage%"
exit 1
fi