44 branches : [master]
55 pull_request :
66 branches : [master]
7- env :
8- snap7-archive-url : https://sourceforge.net/projects/snap7/files/1.4.2/snap7-full-1.4.2.7z/download
97jobs :
108 windows-build :
119 name : Build wheel for windows
1412 - name : Checkout
1513 uses : actions/checkout@v3
1614
17- - name : Install choco packages
18- run : choco install --allow-downgrade wget --version 1.20.3.20190531
19-
20- - name : Cache snap7-archive
21- id : snap7-archive
22- uses : actions/cache@v3
23- with :
24- path : snap7-full-1.4.2.7z
25- key : ${{ env.snap7-archive-url }}
26-
27- - name : Get snap7
28- if : steps.snap7-archive.outputs.cache-hit != 'true'
29- run : |
30- wget -O snap7-full-1.4.2.7z --content-disposition -c ${{ env.snap7-archive-url }}
31-
32- - name : Extract archive
33- run : 7z x snap7-full-1.4.2.7z
34-
35- - name : Update wheel
36- run : python3 -m pip install wheel --upgrade
15+ - name : prepare snap7 archive
16+ uses : ./.github/actions/prepare_snap7
3717
3818 - name : Build wheel
3919 run : python3 setup.py bdist_wheel --plat-name win_amd64
5434 - name : Checkout
5535 uses : actions/checkout@v3
5636
57- - name : Cache snap7-archive
58- id : snap7-archive
59- uses : actions/cache@v3
60- with :
61- path : snap7-full-1.4.2.7z
62- key : ${{ env.snap7-archive-url }}
63-
64- - name : Get snap7
65- if : steps.snap7-archive.outputs.cache-hit != 'true'
66- run : wget -O snap7-full-1.4.2.7z --content-disposition -c ${{ env.snap7-archive-url }}
67-
68- - name : Extract archive
69- run : 7z x snap7-full-1.4.2.7z
70-
71- - name : Copy files
72- run : |
73- mkdir src
74- cp snap7-full-1.4.2/release/Wrappers/c-cpp/snap7.h src
75- cp .github/build_scripts/dummy.c ./
76-
77- - name : Update wheel
78- run : python -m pip install --upgrade wheel
37+ - name : prepare snap7 archive
38+ uses : ./.github/actions/prepare_snap7
7939
8040 - name : Build pure python wheel
8141 run : python3 setup.py bdist_wheel --plat-name=manylinux1_x86_64
@@ -105,27 +65,12 @@ jobs:
10565 steps :
10666 - name : Checkout
10767 uses : actions/checkout@v3
108-
109- - name : Cache snap7-archive
110- id : snap7-archive
111- uses : actions/cache@v3
112- with :
113- path : snap7-full-1.4.2.7z
114- key : ${{ env.snap7-archive-url }}
115-
116- - name : Get snap7
117- if : steps.snap7-archive.outputs.cache-hit != 'true'
118- run : |
119- wget -nv -O snap7-full-1.4.2.7z --content-disposition -c ${{ env.snap7-archive-url }}
120-
121- - name : Extract archive
122- run : 7z x snap7-full-1.4.2.7z
68+
69+ - name : prepare snap7 archive
70+ uses : ./.github/actions/prepare_snap7
12371
12472 - name : Copy files
12573 run : |
126- mkdir src
127- cp snap7-full-1.4.2/release/Wrappers/c-cpp/snap7.h src
128- cp .github/build_scripts/dummy.c ./
12974 cp .github/build_scripts/arm64_osx.mk snap7-full-1.4.2/build/osx/
13075 pushd snap7-full-1.4.2/build/osx/
13176 make -f x86_64_osx.mk all
@@ -165,7 +110,7 @@ jobs:
165110 strategy :
166111 matrix :
167112 os : [ubuntu-latest, macos-latest, windows-latest]
168- python-version : ["3.7", "3.8", "3.9", "3.10"]
113+ python-version : ["3.7", "3.8", "3.9", "3.10", "3.11" ]
169114 steps :
170115 - name : Checkout
171116 uses : actions/checkout@v3
@@ -178,7 +123,7 @@ jobs:
178123 - name : Install pytest
179124 run : |
180125 python3 -m pip install --upgrade pip
181- python3 -m pip install pytest
126+ python3 -m pip install pytest pytest-asyncio
182127
183128 - name : Download artifacts
184129 uses : actions/download-artifact@v3
@@ -192,16 +137,16 @@ jobs:
192137 - name : Run pytest
193138 run : |
194139 which pytest
195- pytest test/test_server.py test/test_util.py test/test_client.py test/test_mainloop.py
140+ pytest -m "server or util or client or mainloop"
196141
197142 - name : Run tests required sudo
198143 if : ${{ runner.os == 'Linux'}}
199- run : sudo /opt/hostedtoolcache/Python/${{ matrix.python-version }}*/x64/bin/pytest test/test_partner.py
144+ run : sudo /opt/hostedtoolcache/Python/${{ matrix.python-version }}*/x64/bin/pytest -m partner
200145
201146 - name : Run tests required sudo
202147 if : ${{ runner.os == 'macOS'}}
203- run : sudo pytest test/test_partner.py
148+ run : sudo pytest -m partner
204149
205150 - name : Run tests required sudo
206151 if : ${{ runner.os == 'Windows'}}
207- run : pytest test/test_partner.py
152+ run : pytest -m partner
0 commit comments