Reuse Azure Functions durable workers (#217) #134
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: Durable Task Scheduler SDK (azure-functions-durable) | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "azurefunctions-v*" # Only run for tags starting with "azurefunctions-v" | |
| pull_request: | |
| branches: | |
| - "main" | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install nox | |
| - name: Run lint checks | |
| run: nox -s lint | |
| run-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.13", "3.14"] | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Nox | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install nox | |
| - name: Run unit tests | |
| run: nox -s functions_unit-${{ matrix.python-version }} | |
| e2e-tests: | |
| needs: run-tests | |
| runs-on: ubuntu-latest | |
| # The end-to-end suite launches a real Azure Functions host, which requires | |
| # ``azure-functions>=2.3.0b2``. That build is published to PyPI and pulled | |
| # in as a declared dependency of ``azure-functions-durable``. | |
| # Run the suite in both payload-typing modes: the default (loose) codec and | |
| # strict typing (``AZURE_FUNCTIONS_DURABLE_STRICT_TYPING=1``), which requires | |
| # every decode call site to supply the destination type. ``0`` is not a | |
| # truthy value for the flag, so it selects loose mode. | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| strict-typing: ["0", "1"] | |
| name: e2e-tests (strict-typing=${{ matrix.strict-typing }}) | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Set up Node.js (needed for Azurite and Functions Core Tools) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Install Azurite and Azure Functions Core Tools | |
| run: | | |
| npm install -g azurite@latest | |
| npm install -g azure-functions-core-tools@4 --unsafe-perm true | |
| - name: Install nox | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install nox | |
| - name: Run end-to-end tests | |
| # nox provisions each sample app's in-app virtual environment (a link to | |
| # a single editable install) so the Functions worker loads our | |
| # grpc/protobuf rather than its bundled copies. | |
| env: | |
| AZURE_FUNCTIONS_DURABLE_STRICT_TYPING: ${{ matrix.strict-typing }} | |
| run: nox -s functions_e2e | |
| # The harness captures each sample app's ``func start`` stdout/stderr to | |
| # ``<app>/_func_host.log``. On failure that log holds the real host/worker | |
| # error (durable extension load, storage wiring, worker crash) that the | |
| # pytest summary does not surface, so upload it for diagnosis. | |
| - name: Upload Functions host logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: func-host-logs-strict-${{ matrix.strict-typing }} | |
| path: tests/azure-functions-durable/e2e/apps/*/_func_host.log | |
| if-no-files-found: warn | |
| retention-days: 7 |