π feat: simplify local usage with SERVER_AUTH_DISABLED mode β all tests pass
#55
This file contains hidden or 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: Tests | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| workflow_call: | |
| permissions: {} # deny all by default | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| MIN_COVERAGE: 70 | |
| COVERAGE_TOLERANCE_MARGIN: 5 | |
| jobs: | |
| filter: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| src_changed: ${{ steps.changes.outputs.py }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Check Changes | |
| uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| py: | |
| - 'src/**/*.py' | |
| lint: | |
| uses: ./.github/workflows/1.1_lint.yml | |
| needs: filter | |
| if: needs.filter.outputs.src_changed == 'true' | |
| permissions: | |
| contents: read | |
| unit-tests: | |
| uses: ./.github/workflows/1.2_unit_tests.yml | |
| needs: lint | |
| permissions: | |
| contents: read | |
| actions: write # reusable workflow uploads artifacts | |
| docker-tests: | |
| uses: ./.github/workflows/1.3_docker_tests.yml | |
| needs: unit-tests | |
| permissions: | |
| contents: read | |
| actions: write # reusable workflow uploads artifacts | |
| kubernetes-tests: | |
| uses: ./.github/workflows/1.4_kubernetes_tests.yml | |
| needs: unit-tests | |
| permissions: | |
| contents: read | |
| actions: write # reusable workflow uploads artifacts | |
| coverage-report: | |
| name: Combine coverage reports and report | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, docker-tests, kubernetes-tests] | |
| timeout-minutes: 2 | |
| permissions: | |
| contents: read | |
| actions: read | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 # checkout cleans the directory by default, needs to be placed before download. | |
| - name: Download coverage data | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: . | |
| pattern: .coverage* | |
| merge-multiple: true # download to same directory | |
| - name: Verify coverage files exist | |
| run: | | |
| for file in .coverage*; do | |
| if [ ! -f "$file" ]; then | |
| echo "Required coverage file not found: $file" | |
| ls -la | |
| exit 1 | |
| fi | |
| done | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| scripts/rich-coverage.py.lock | |
| - name: Combine and report coverage | |
| run: uv run ./scripts/rich-coverage.py --format=html >> $GITHUB_STEP_SUMMARY # no need to install dependencies | |
| check: | |
| name: Did all tests pass? | |
| if: always() | |
| runs-on: Ubuntu-latest | |
| needs: [lint, unit-tests, docker-tests, kubernetes-tests, coverage-report] | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| # allowed-failures: [] | |
| allowed-skips: "lint, unit-tests, docker-tests, kubernetes-tests, coverage-report" | |
| jobs: ${{ toJSON(needs) }} |