Merge pull request #2193 from auslin-aot/bugfix/changed-service-url #6
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
name: Forms Flow Document CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- develop | |
- master | |
- release/** | |
pull_request: | |
branches: | |
- develop | |
- master | |
- release/** | |
paths: | |
- "forms-flow-documents/**" | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./forms-flow-documents | |
jobs: | |
setup-job: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- run: "true" | |
Lint: | |
needs: setup-job | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [3.12.4] | |
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_documents | |
- name: Flake8 | |
id: flake8 | |
run: | | |
flake8 src/formsflow_documents tests | |
Test: | |
needs: setup-job | |
env: | |
FLASK_ENV: "testing" | |
DATABASE_URL_TEST: "postgresql://postgres:postgres@localhost:5432/postgres" | |
FORMSFLOW_API_URL: "http://localhost:5000" | |
FORMSFLOW_DOC_API_URL: "http://localhost:5006" | |
JWT_OIDC_ALGORITHMS: "RS256" | |
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_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" | |
FORMIO_URL: http://localhost:8080/forms | |
FORMIO_ROOT_EMAIL: [email protected] | |
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 Docker Compose | |
run: | | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
docker-compose --version | |
- name: Check for docker-compose.yml | |
run: | | |
if [ ! -f tests/docker/docker-compose.yml ]; then | |
echo "docker-compose.yml not found!" | |
exit 1 | |
fi | |
- name: Install dependencies | |
run: | | |
make build | |
- name: Test | |
id: test | |
run: | | |
make test | |
Build: | |
if: always() | |
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-documents |