Updated README #35
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: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| permissions: | |
| contents: read | |
| env: | |
| UV_CACHE_DIR: .uv-cache | |
| jobs: | |
| dependency-check: | |
| name: Dependency and lockfile check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| version: "latest" | |
| - name: Restore uv cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .uv-cache | |
| key: uv-${{ runner.os }}-3.11-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}-3.11- | |
| - name: Verify lockfile is current | |
| run: uv lock --check | |
| - name: Verify test environment resolves from lockfile | |
| run: uv sync --frozen --extra server --extra client-static --extra test | |
| fast-tests: | |
| name: Fast unit and resilience tests | |
| runs-on: ubuntu-latest | |
| needs: dependency-check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| version: "latest" | |
| - name: Restore uv cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .uv-cache | |
| key: uv-${{ runner.os }}-3.11-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}-3.11- | |
| - name: Install dependencies | |
| run: uv sync --frozen --extra server --extra client-static --extra test | |
| - name: Run fast tests | |
| run: | | |
| mkdir -p reports | |
| uv run pytest \ | |
| tests/unit \ | |
| tests/integration/test_client_resilience.py \ | |
| tests/integration/test_client_lifecycle.py \ | |
| tests/integration/test_variance_and_local_inference.py \ | |
| tests/test_mqtt_client \ | |
| tests/test_offloading_algo \ | |
| -v \ | |
| --cov=client \ | |
| --cov=server \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml:coverage-fast.xml \ | |
| --junitxml=reports/fast-tests.xml | |
| - name: Upload fast test report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: fast-test-report | |
| path: | | |
| reports/fast-tests.xml | |
| coverage-fast.xml | |
| - name: Upload fast coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage-fast.xml | |
| flags: fast-tests | |
| name: fast-tests | |
| fail_ci_if_error: false | |
| http-integration: | |
| name: HTTP integration tests | |
| runs-on: ubuntu-latest | |
| needs: dependency-check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| version: "latest" | |
| - name: Restore uv cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .uv-cache | |
| key: uv-${{ runner.os }}-3.11-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}-3.11- | |
| - name: Install dependencies | |
| run: uv sync --frozen --extra server --extra client-static --extra test | |
| - name: Run HTTP integration tests | |
| run: | | |
| mkdir -p reports | |
| uv run pytest \ | |
| tests/integration/test_http_end_to_end.py \ | |
| tests/integration/test_http_protocol_validation.py \ | |
| -v \ | |
| --cov=client \ | |
| --cov=server \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml:coverage-http.xml \ | |
| --junitxml=reports/http-integration.xml | |
| - name: Upload HTTP integration report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: http-integration-report | |
| path: | | |
| reports/http-integration.xml | |
| coverage-http.xml | |
| - name: Upload HTTP integration coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage-http.xml | |
| flags: http-integration | |
| name: http-integration | |
| fail_ci_if_error: false |