test: added in open datasoft health test [2024-12-02] #56
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: HerdingCats Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "tests/**" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest-cov | |
poetry install --no-interaction | |
- name: Create pytest.ini | |
run: | | |
echo "[pytest]" > pytest.ini | |
echo "pythonpath = ." >> pytest.ini | |
- name: Run tests with coverage | |
run: | | |
pytest tests/ --cov=./ --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
verbose: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |