forked from AOT-Technologies/forms-flow-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (116 loc) · 3.38 KB
/
forms-flow-api-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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Forms Flow API CI
on:
workflow_dispatch:
push:
branches:
- develop
- master
- release/**
pull_request:
branches:
- develop
- master
- release/**
paths:
- "forms-flow-api/**"
defaults:
run:
shell: bash
working-directory: ./forms-flow-api
jobs:
setup-job:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: "true"
Lint:
if: always()
needs: setup-job
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.12.2]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements/dev.txt
- name: Pylint
id: pylint
run: |
pylint --rcfile=setup.cfg src/formsflow_api
- name: Flake8
id: flake8
run: |
flake8 src/formsflow_api tests
Test:
if: always()
needs: setup-job
name: Test
env:
FLASK_ENV: "testing"
DATABASE_URL_TEST: "postgresql://postgres:postgres@localhost:5432/postgres"
FORMSFLOW_API_URL: "http://localhost:5000"
KEYCLOAK_URL: "http://localhost:8081"
KEYCLOAK_URL_REALM: "forms-flow-ai"
KEYCLOAK_BPM_CLIENT_SECRET: "demo"
JWT_OIDC_WELL_KNOWN_CONFIG: "http://localhost:8081/auth/realms/forms-flow-ai/.well-known/openid-configuration"
JWT_OIDC_ALGORITHMS: "RS256"
JWT_OIDC_JWKS_URI: "http://localhost:8081/auth/realms/forms-flow-ai/protocol/openid-connect/certs"
JWT_OIDC_ISSUER: "http://localhost:8081/auth/realms/forms-flow-ai"
JWT_OIDC_AUDIENCE: "forms-flow-web"
JWT_OIDC_CACHING_ENABLED: "True"
BPM_API_URL: http://localhost:8080/camunda
BPM_CLIENT_SECRET: "demo"
BPM_CLIENT_ID: "forms-flow-bpm"
BPM_TOKEN_API: "http://localhost:8081/auth/realms/forms-flow-ai/protocol/openid-connect/token"
INSIGHT_API_URL: http://localhost:8080/analytics
INSIGHT_API_KEY: test
FORMIO_URL: http://localhost:8080/forms
FORMIO_ROOT_EMAIL: test@test.com
FORMIO_ROOT_PASSWORD: test
SKIP_IN_CI: "True"
USE_DOCKER_MOCK: "True"
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make build
- name: Test
id: test
run: |
make test
Build:
if: always()
needs: setup-job
runs-on: ubuntu-20.04
name: Build
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
docker build . -t forms-flow-api