-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (45 loc) · 1.31 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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@v2
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
- name: Run tests with pytest and generate coverage
run: |
cd training
pytest --cov=. --cov-report=xml --cov-report=term-missing
- name: Upload coverage report
uses: actions/upload-artifact@v2
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