fix pipeline #26
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: CI | |
on: | |
push: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
# Push events on main and dev branch | |
- main | |
- training-tests | |
# Sequence of patterns matched against refs/tags | |
tags: '*' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Make run.sh executable | |
run: chmod +x ./run.sh | |
- name: Docker build training, backend, and frontend | |
run: ./run.sh | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r training/requirements.txt | |
pip install pytest pytest-cov | |
cd training && pip install -e . | |
- name: Run tests with pytest and generate coverage | |
run: | | |
export PYTHONPATH=$PYTHONPATH:$(pwd) | |
echo $PYTHONPATH | |
python -m pytest --cov=. --cov-report=xml --cov-report=term-missing | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: training/coverage.xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./training/coverage.xml | |
fail_ci_if_error: true |