-
Notifications
You must be signed in to change notification settings - Fork 62
84 lines (70 loc) · 2.3 KB
/
python-api-tests.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This workflow will install Python dependencies and run tests with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: API - tests
on:
workflow_dispatch:
push:
branches: [ 'main' ]
paths:
- python/**
pull_request:
branches: [ '*' ]
paths:
- python/**
env:
TAIGA_SECRET_KEY: secret
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.11' ]
redis-version: [7]
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: taiga
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: '--health-cmd "pg_isready" --health-interval 5s --health-timeout 5s --health-retries 6 --health-start-period 20s'
name: Test on Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: ${{ matrix.redis-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/setup.py
**/setup.cfg
**/requirements*.txt
- name: Install requirements
working-directory: ./python/apps/taiga
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install -r requirements/devel.txt
python -m pip install -e .
- name: Compiling locales
working-directory: ./python/apps/taiga
run: |
python -m taiga i18n compile-catalog
- name: Test with pytest
working-directory: ./python/apps/taiga
run: |
set -o pipefail
python -m pytest -s --cov --cov-report=term-missing:skip-covered --junitxml=pytest.xml | tee pytest-coverage.txt
set +o pipefail
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: python/apps/taiga/pytest-coverage.txt
junitxml-path: python/apps/taiga/pytest.xml