Add fault tolerance support during migration #63
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: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| id-token: write # required for Codecov OIDC upload | |
| jobs: | |
| unit-tests-coordinator: | |
| name: Unit tests (coordinator) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools Cython | |
| cd styx-package && python setup.py build_ext --inplace && cd .. | |
| python -m pip install styx-package/ | |
| python -m pip install -r coordinator/requirements.txt | |
| python -m pip install pytest==9.0.2 pytest-cov pytest-asyncio | |
| - name: Run coordinator unit tests | |
| run: pytest tests/unit/coordinator/ -v --cov=coordinator --cov-report=xml:coverage-coordinator.xml | |
| - name: Upload coordinator coverage to Codecov | |
| uses: codecov/codecov-action@v5.5.3 | |
| with: | |
| files: coverage-coordinator.xml | |
| flags: coordinator | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| unit-tests-worker: | |
| name: Unit tests (worker) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools Cython | |
| cd styx-package && python setup.py build_ext --inplace && cd .. | |
| python -m pip install styx-package/ | |
| python -m pip install msgspec pytest==9.0.2 pytest-cov pytest-asyncio psutil uvloop | |
| - name: Build Cython extensions | |
| run: python worker/setup.py build_ext --inplace | |
| - name: Run worker unit tests | |
| run: pytest tests/unit/worker/ -v --cov=worker --cov-report=xml:coverage-worker.xml | |
| - name: Upload worker coverage to Codecov | |
| uses: codecov/codecov-action@v5.5.3 | |
| with: | |
| files: coverage-worker.xml | |
| flags: worker | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| unit-tests-styx-package: | |
| name: Unit tests (styx-package) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools Cython | |
| cd styx-package && python setup.py build_ext --inplace && cd .. | |
| python -m pip install -e styx-package/ | |
| python -m pip install pytest==9.0.2 pytest-cov pytest-asyncio | |
| - name: Run styx-package unit tests | |
| run: pytest tests/unit/styx_package/ -v --cov=styx-package/styx --cov-report=xml:coverage-styx-package.xml | |
| - name: Upload styx-package coverage to Codecov | |
| uses: codecov/codecov-action@v5.5.3 | |
| with: | |
| files: coverage-styx-package.xml | |
| flags: styx-package | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| integration-tests: | |
| name: Integration tests | |
| needs: [unit-tests-coordinator, unit-tests-worker, unit-tests-styx-package] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools Cython | |
| cd styx-package && python setup.py build_ext --inplace && cd .. | |
| python -m pip install styx-package/ | |
| python worker/setup.py build_ext --inplace | |
| python -m pip install pytest==9.0.2 pytest-asyncio pytest-cov "testcontainers[kafka,minio]>=4.14.1" | |
| - name: Run integration tests | |
| run: pytest tests/integration/ -v --cov=styx-package/styx --cov=coordinator --cov=worker --cov-report=xml:coverage-integration.xml | |
| - name: Upload integration coverage to Codecov | |
| uses: codecov/codecov-action@v5.5.3 | |
| with: | |
| files: coverage-integration.xml | |
| flags: integration | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true |