Skip to content

added description to external ids in swagger docs #2763

added description to external ids in swagger docs

added description to external ids in swagger docs #2763

Workflow file for this run

name: Build and Test
on:
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- "web-app/**"
- "functions/**"
- ".github/workflows/web-*.yml"
workflow_call:
inputs:
SKIP_TESTS:
description: The skip test parameter is useful for DEV environment deployments, not advised for QA and PROD.
required: false
type: boolean
default: false
env:
python_version: '3.11'
java_version: '11' # needed by setup-openapi-generator.sh
liquibase_version: '4.33.0'
jobs:
build-test:
runs-on: ubuntu-latest
permissions: write-all
name: Build & Test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set whether to run tests
id: set-should-run-tests
run: |
if [ "$GITHUB_EVENT_NAME" != "workflow_call" ] && [ "$GITHUB_EVENT_NAME" != "workflow_dispatch" ]; then
echo "result=true" >> "$GITHUB_OUTPUT"
elif [[ "$INPUTS_SKIP_TESTS" == "false" ]]; then
echo "result=true" >> "$GITHUB_OUTPUT"
else
echo "result=false" >> "$GITHUB_OUTPUT"
fi
env:
INPUTS_SKIP_TESTS: ${{ inputs.SKIP_TESTS }}
- name: Extract commit hash and version from git
run: ./scripts/extract-hash-and-version.sh
- name: Set up JDK ${{ env.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.java_version }}
distribution: 'temurin'
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}
- name: Docker Compose DB
run: |
docker compose --env-file ./config/.env.local up -d postgres postgres-test
working-directory: ${{ github.workspace }}
- name: Run lint checks
if: ${{ steps.set-should-run-tests.outputs.result == 'true' }}
shell: bash
run: |
scripts/lint-tests.sh
- name: Install Liquibase
env:
LIQUIBASE_VERSION: ${{ env.liquibase_version }}
run: |
curl -sSL https://github.com/liquibase/liquibase/releases/download/v${LIQUIBASE_VERSION}/liquibase-${LIQUIBASE_VERSION}.tar.gz -o liquibase.tar.gz
rm -rf liquibase-dist
mkdir liquibase-dist
tar -xzf liquibase.tar.gz -C liquibase-dist
sudo rm -rf /usr/local/liquibase
sudo mv liquibase-dist /usr/local/liquibase
sudo ln -sf /usr/local/liquibase/liquibase /usr/local/bin/liquibase
liquibase --version
- name: Run Liquibase on Python functions test DB
working-directory: ${{ github.workspace }}/liquibase
run: |
export LIQUIBASE_COMMAND_CHANGELOG_FILE="changelog.xml"
export LIQUIBASE_COMMAND_URL=jdbc:postgresql://localhost:54320/MobilityDatabaseTest
export LIQUIBASE_COMMAND_USERNAME=postgres
export LIQUIBASE_COMMAND_PASSWORD=postgres
liquibase update
- name: Generate DB code
run: |
export USE_TEST_DB=true
scripts/db-gen.sh
- name: Generate API code
run: |
scripts/setup-openapi-generator.sh
scripts/api-gen.sh
- name: Generate Operations API code
run: |
scripts/api-operations-gen.sh
- name: Unit tests - API
if: ${{ steps.set-should-run-tests.outputs.result == 'true' }}
shell: bash
run: |
scripts/api-tests.sh --folder api --html_report
- name: Unit tests - Python Functions
if: ${{ steps.set-should-run-tests.outputs.result == 'true' }}
shell: bash
run: |
scripts/api-tests.sh --folder functions-python --html_report
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: ${{ steps.set-should-run-tests.outputs.result == 'true' }}
with:
name: coverage_report
path: scripts/coverage_reports/
overwrite: true
- name: Upload DB models
uses: actions/upload-artifact@v4
with:
name: database_gen
path: api/src/shared/database_gen/
overwrite: true
- name: Upload API generated code
uses: actions/upload-artifact@v4
with:
name: feeds_gen
path: api/src/feeds_gen/
overwrite: true
- name: Upload Operations API generated code
uses: actions/upload-artifact@v4
with:
name: feeds_operations_gen
path: functions-python/operations_api/src/feeds_gen/
overwrite: true