Skip to content

Fix health check ping fallback and implement healthy-auth-expired sta… #109

Fix health check ping fallback and implement healthy-auth-expired sta…

Fix health check ping fallback and implement healthy-auth-expired sta… #109

Workflow file for this run

name: πŸ§ͺ Test Suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
test:
name: "πŸ§ͺ Test (${{ matrix.python-version }})"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
fail-fast: false
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: πŸ“¦ Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: πŸ”§ Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: πŸ” Check dependencies
run: |
python scripts/test.py check
- name: πŸ§ͺ Run unit tests
run: |
python scripts/test.py unit
- name: πŸ”— Run integration tests
run: |
python scripts/test.py integration
- name: πŸ“Š Generate coverage report
run: |
python scripts/test.py coverage
- name: πŸ“€ Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: πŸ“„ Upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage-report-${{ matrix.python-version }}
path: htmlcov/
- name: πŸ“‹ Upload test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports-${{ matrix.python-version }}
path: tests/reports/
lint:
name: "πŸ” Code Quality"
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: πŸ“¦ Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit black isort flake8
- name: πŸ”’ Security check with bandit
run: |
bandit -r registry/ -f json -o bandit-report.json || true
- name: πŸ“‹ Upload security report
uses: actions/upload-artifact@v3
if: always()
with:
name: security-report
path: bandit-report.json
domain-tests:
name: "πŸ—οΈ Domain Tests"
runs-on: ubuntu-latest
strategy:
matrix:
domain: [auth, servers, search, health, core]
fail-fast: false
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: πŸ“¦ Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: πŸ—οΈ Test ${{ matrix.domain }} domain
run: |
python scripts/test.py ${{ matrix.domain }}
fast-feedback:
name: "⚑ Fast Feedback"
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: πŸ“¦ Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: ⚑ Run fast tests
run: |
python scripts/test.py fast
summary:
name: "πŸ“‹ Test Summary"
runs-on: ubuntu-latest
needs: [test, lint, domain-tests]
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 "| Main Tests | ${{ needs.test.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Code Quality | ${{ needs.lint.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Domain Tests | ${{ needs.domain-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.test.result }}" == "success" && "${{ needs.lint.result }}" == "success" && "${{ needs.domain-tests.result }}" == "success" ]]; then
echo "βœ… All tests passed! πŸŽ‰" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Some tests failed. Please check the logs." >> $GITHUB_STEP_SUMMARY
fi