Pere Miquel Brull 9a96ddd4ae
GEN-1494 - Add CI for py-tests with Postgres and Opensearch (#17853)
* GEN-1494 - Add CI for py-tests with Postgres and Opensearch

* GEN-1410 - Improve PII Logging information

* GEN-1494 - Add CI for py-tests with Postgres and Opensearch

* allow_module_level=True
2024-09-16 09:35:38 +02:00

67 lines
2.4 KiB
YAML

name: Setup OpenMetadata Test Environment
description: Steps needed to have a coherent test environment
inputs:
python-version:
description: Python Version to install
required: true
args:
description: Arguments to pass to run_local_docker.sh
required: false
default: "-m no-ui -d mysql" # Use "-d postgresql" for postgres and Opensearch
ingestion_dependency:
description: Ingestion dependency to pass to run_local_docker.sh
required: false
default: "mysql,elasticsearch,sample-data"
runs:
using: composite
steps:
# ---- Install Ubuntu Dependencies ---------------------------------------------
- name: Install Ubuntu dependencies
run: |
sudo apt-get update && sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \
libevent-dev python3-dev libkrb5-dev tdsodbc && ACCEPT_EULA=Y sudo apt-get -qq install -y msodbcsql18
shell: bash
# ------------------------------------------------------------------------------
# ---- Setup Java --------------------------------------------------------------
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# ------------------------------------------------------------------------------
# ---- Setup Python Test Environment -------------------------------------------
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Generate Models
run: |
python3 -m venv env
source env/bin/activate
sudo make install_antlr_cli
make install_dev generate
shell: bash
- name: Install Python Dependencies
run: |
source env/bin/activate
make install_all install_test
shell: bash
# ------------------------------------------------------------------------------
# ---- Start OpenMetadata Server and ingest Sample Data ------------------------
- name: Start Server and Ingest Sample Data
uses: nick-fields/retry@v2.8.3
env:
INGESTION_DEPENDENCY: ${{ inputs.ingestion_dependency }}
with:
timeout_minutes: 60
max_attempts: 2
retry_on: error
command: ./docker/run_local_docker.sh ${{ inputs.args }}