1+ name : Durable Task Scheduler SDK (durabletask-azurefunctions)
2+
3+ on :
4+ push :
5+ branches :
6+ - " main"
7+ tags :
8+ - " azurefunctions-v*" # Only run for tags starting with "azurefunctions-v"
9+ pull_request :
10+ branches :
11+ - " main"
12+
13+ jobs :
14+ lint :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ - name : Set up Python 3.14
19+ uses : actions/setup-python@v5
20+ with :
21+ python-version : 3.14
22+ - name : Install dependencies
23+ working-directory : durabletask-azurefunctions
24+ run : |
25+ python -m pip install --upgrade pip
26+ pip install setuptools wheel tox
27+ pip install flake8
28+ - name : Run flake8 Linter
29+ working-directory : durabletask-azurefunctions
30+ run : flake8 .
31+ - name : Run flake8 Linter
32+ working-directory : tests/durabletask-azurefunctions
33+ run : flake8 .
34+
35+ run-docker-tests :
36+ strategy :
37+ fail-fast : false
38+ matrix :
39+ python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
40+ env :
41+ EMULATOR_VERSION : " latest"
42+ needs : lint
43+ runs-on : ubuntu-latest
44+ steps :
45+ - name : Checkout repository
46+ uses : actions/checkout@v4
47+
48+ - name : Pull Docker image
49+ run : docker pull mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION
50+
51+ - name : Run Docker container
52+ run : |
53+ docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION
54+
55+ - name : Wait for container to be ready
56+ run : sleep 10 # Adjust if your service needs more time to start
57+
58+ - name : Set environment variables
59+ run : |
60+ echo "TASKHUB=default" >> $GITHUB_ENV
61+ echo "ENDPOINT=http://localhost:8080" >> $GITHUB_ENV
62+
63+ - name : Install durabletask dependencies
64+ run : |
65+ python -m pip install --upgrade pip
66+ pip install flake8 pytest
67+ pip install -r requirements.txt
68+
69+ - name : Install durabletask-azurefunctions dependencies
70+ working-directory : examples
71+ run : |
72+ python -m pip install --upgrade pip
73+ pip install -r requirements.txt
74+
75+ - name : Install durabletask-azurefunctions locally
76+ working-directory : durabletask-azurefunctions
77+ run : |
78+ pip install . --no-deps --force-reinstall
79+
80+ - name : Install durabletask locally
81+ run : |
82+ pip install . --no-deps --force-reinstall
83+
84+ - name : Run the tests
85+ working-directory : tests/durabletask-azurefunctions
86+ run : |
87+ pytest -m "dts" --verbose
88+
89+ publish :
90+ if : startsWith(github.ref, 'refs/tags/azurefunctions-v') # Only run if a matching tag is pushed
91+ needs : run-docker-tests
92+ runs-on : ubuntu-latest
93+ steps :
94+ - name : Checkout code
95+ uses : actions/checkout@v4
96+
97+ - name : Extract version from tag
98+ run : echo "VERSION=${GITHUB_REF#refs/tags/azurefunctions-v}" >> $GITHUB_ENV # Extract version from the tag
99+
100+ - name : Set up Python
101+ uses : actions/setup-python@v5
102+ with :
103+ python-version : " 3.14" # Adjust Python version as needed
104+
105+ - name : Install dependencies
106+ run : |
107+ python -m pip install --upgrade pip
108+ pip install build twine
109+
110+ - name : Build package from directory durabletask-azurefunctions
111+ working-directory : durabletask-azurefunctions
112+ run : |
113+ python -m build
114+
115+ - name : Check package
116+ working-directory : durabletask-azurefunctions
117+ run : |
118+ twine check dist/*
119+
120+ - name : Publish package to PyPI
121+ env :
122+ TWINE_USERNAME : __token__
123+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN_AZUREFUNCTIONS }} # Store your PyPI API token in GitHub Secrets
124+ working-directory : durabletask-azurefunctions
125+ run : |
126+ twine upload dist/*
0 commit comments