-
Notifications
You must be signed in to change notification settings - Fork 62
103 lines (88 loc) · 3.22 KB
/
python-api-e2e.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 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 - e2e
on:
workflow_dispatch:
push:
branches: [ 'main' ]
paths:
- python/**
pull_request:
branches: [ '*' ]
paths:
- python/**
jobs:
newman:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.11' ]
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: Postgres restore fixture
run: |
pg_restore --no-privileges --no-owner --dbname="postgres://postgres:postgres@localhost:5432/taiga" "./.github/sql-fixtures/fixtures.sql"
- 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: Run back server
working-directory: ./python/apps/taiga
run: |
python -m taiga devserve -w > taiga-back.log 2> taiga-back.err &
env:
TAIGA_EVENTS__PUBSUB_BACKEND: "memory"
TAIGA_DEBUG: true
TAIGA_DB_NAME: taiga
TAIGA_DB_USER: postgres
TAIGA_DB_PASSWORD: postgres
TAIGA_DB_HOST: localhost
TAIGA_DB_PORT: 5432
TAIGA_SECRET_KEY: secret
TAIGA_ACCESS_TOKEN_LIFETIME: 1000000
- name: Postman API tests
run: |
newman run ./python/docs/postman/taiga.postman_collection_e2e.json \
-e ./python/docs/postman/taiga.postman_environment.json --verbose \
--reporters cli,json --reporter-json-export .github/workflows/artifacts/python-apps-taiga-api-tests.json
- name: Log test results as an artifact json
if: always()
uses: actions/upload-artifact@v3
with:
name: python-apps-taiga-api-tests.json
path: ./.github/workflows/artifacts/python-apps-taiga-api-tests.json
- name: Log taiga back server logs to an artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: taiga-back-log
path: ./python/apps/taiga/taiga-back.log
- name: Log taiga back server errors to an artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: taiga-back-err
path: ./python/apps/taiga/taiga-back.err