feat(workflow): u#1540 t#4000 create workflow endpoint #789
Workflow file for this run
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
# 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 |