Skip to content

fix(keycloak): make the container healthcheck runnable inside the image #2162

fix(keycloak): make the container healthcheck runnable inside the image

fix(keycloak): make the container healthcheck runnable inside the image #2162

Workflow file for this run

name: Registry Test Suite
on:
push:
branches: [main, develop]
# No path filters - run on every merge to main/develop
pull_request:
branches: [main, develop]
paths:
- 'registry/**'
- 'tests/**'
- 'pyproject.toml'
- 'scripts/test.py'
- '.github/workflows/registry-test.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: "Test (Python ${{ matrix.python-version }})"
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.14"]
fail-fast: false
services:
mongodb:
image: mongo:8.2
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.runCommand({ping:1})' --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DOCUMENTDB_HOST: localhost
DOCUMENTDB_PORT: "27017"
APP_LOG_MONGODB_ENABLED: "false"
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "latest"
- name: Cache dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-${{ matrix.python-version }}-
${{ runner.os }}-uv-
- name: Install dependencies
run: |
uv sync --extra dev
- name: Check dependencies
run: |
uv run python scripts/test.py check
- name: Run all tests with coverage
run: |
uv run python scripts/test.py coverage -n 8
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
file: ./coverage.xml
flags: unittests
name: codecov-python-${{ matrix.python-version }}
fail_ci_if_error: false
- name: Upload coverage HTML report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: coverage-report-${{ matrix.python-version }}
path: htmlcov/
retention-days: 14
- name: Upload test reports
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: test-reports-${{ matrix.python-version }}
path: tests/reports/
retention-days: 14
lint:
name: "Code Quality"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "latest"
- name: Cache dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-lint-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-lint-
- name: Install dependencies
run: |
uv pip install --system ruff
- name: Run ruff check
run: |
ruff check registry/ tests/
continue-on-error: true
- name: Run ruff format check
run: |
ruff format --check registry/ tests/
continue-on-error: true
security:
name: "Security Check"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "latest"
- name: Install bandit
run: |
uv pip install --system bandit
- name: Run bandit security scan
run: |
bandit -r registry/ -f json -o bandit-report.json || true
- name: Upload security report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: security-report
path: bandit-report.json
retention-days: 14
summary:
name: "Test Summary"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [test, lint, security]
if: always()
steps:
- name: Test Results Summary
run: |
echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Tests | ${{ needs.test.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Code Quality | ${{ needs.lint.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Security | ${{ needs.security.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.test.result }}" == "success" && "${{ needs.lint.result }}" == "success" && "${{ needs.security.result }}" == "success" ]]; then
echo "All checks passed!" >> $GITHUB_STEP_SUMMARY
else
echo "Some checks failed. Please review the logs." >> $GITHUB_STEP_SUMMARY
fi