-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (35 loc) · 1.21 KB
/
test.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
name: Test API workflow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Test python API
steps:
- uses: actions/checkout@v3
- name: Set up uWSGI dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: gcc python3-dev build-essential libpcre3 libpcre3-dev
version: 1.0
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.10'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install requirements
working-directory: ./backend
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Run tests and collect coverage
working-directory: ./backend
run: pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}