|
| 1 | +name: Durable Task Scheduler SDK (durabletask-azuremanaged) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + tags: |
| 8 | + - "azuremanaged-v*" # Only run for tags starting with "azuremanaged-v" |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - "main" |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +jobs: |
| 17 | + lint: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - name: Set up Python 3.14 |
| 22 | + uses: actions/setup-python@v5 |
| 23 | + with: |
| 24 | + python-version: 3.14 |
| 25 | + - name: Install dependencies |
| 26 | + working-directory: durabletask-azuremanaged |
| 27 | + run: | |
| 28 | + python -m pip install --upgrade pip |
| 29 | + pip install setuptools wheel tox |
| 30 | + pip install flake8 |
| 31 | + - name: Run flake8 Linter |
| 32 | + working-directory: durabletask-azuremanaged |
| 33 | + run: flake8 . |
| 34 | + - name: Run flake8 Linter |
| 35 | + working-directory: tests/durabletask-azuremanaged |
| 36 | + run: flake8 . |
| 37 | + |
| 38 | + run-docker-tests: |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 43 | + env: |
| 44 | + EMULATOR_VERSION: "latest" |
| 45 | + needs: lint |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - name: Checkout repository |
| 49 | + uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Pull Docker image |
| 52 | + run: docker pull mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION |
| 53 | + |
| 54 | + - name: Run Docker container |
| 55 | + run: | |
| 56 | + docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION |
| 57 | +
|
| 58 | + - name: Wait for container to be ready |
| 59 | + run: sleep 10 # Adjust if your service needs more time to start |
| 60 | + |
| 61 | + - name: Set environment variables |
| 62 | + run: | |
| 63 | + echo "TASKHUB=default" >> $GITHUB_ENV |
| 64 | + echo "ENDPOINT=http://localhost:8080" >> $GITHUB_ENV |
| 65 | +
|
| 66 | + - name: Install durabletask dependencies |
| 67 | + run: | |
| 68 | + python -m pip install --upgrade pip |
| 69 | + pip install flake8 pytest |
| 70 | + pip install -r requirements.txt |
| 71 | +
|
| 72 | + - name: Install durabletask-azuremanaged dependencies |
| 73 | + working-directory: examples |
| 74 | + run: | |
| 75 | + python -m pip install --upgrade pip |
| 76 | + pip install -r requirements.txt |
| 77 | +
|
| 78 | + - name: Install durabletask-azuremanaged locally |
| 79 | + working-directory: durabletask-azuremanaged |
| 80 | + run: | |
| 81 | + pip install . --no-deps --force-reinstall |
| 82 | +
|
| 83 | + - name: Install durabletask locally |
| 84 | + run: | |
| 85 | + pip install . --no-deps --force-reinstall |
| 86 | +
|
| 87 | + - name: Run the tests |
| 88 | + working-directory: tests/durabletask-azuremanaged |
| 89 | + run: | |
| 90 | + pytest -m "dts" --verbose |
0 commit comments