@@ -19,54 +19,54 @@ concurrency:
1919
2020jobs :
2121
22- # labeler:
23- # name: "Labels"
24- # permissions:
25- # contents: read
26- # pull-requests: write
27- # runs-on: ubuntu-latest
28- # steps:
29- # - uses: actions/checkout@v4
30- #
31- # - name: "Update labels"
32- # uses: micnncim/action-label-syncer@v1
33- # env:
34- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35- #
36- # - name: "Label pull-request"
37- 38- # with:
39- # repo-token: ${{ secrets.GITHUB_TOKEN }}
40- #
41- # branch-name-style:
42- # name: "Branch style checks"
43- # runs-on: ubuntu-latest
44- # needs: labeler
45- # steps:
46- # - uses: ansys/actions/branch-name-style@v5
47- #
48- # code-style:
49- # name: "Code style checks"
50- # runs-on: ubuntu-latest
51- # needs: branch-name-style
52- # steps:
53- # - uses: ansys/actions/code-style@v5
54- # with:
55- # python-version: ${{ env.MAIN_PYTHON_VERSION }}
56- #
57- # doc-style:
58- # name: "Doc style checks"
59- # runs-on: ubuntu-latest
60- # needs: branch-name-style
61- # steps:
62- # - uses: ansys/actions/doc-style@v5
63- # with:
64- # token: ${{ secrets.GITHUB_TOKEN }}
22+ labeler :
23+ name : " Labels"
24+ permissions :
25+ contents : read
26+ pull-requests : write
27+ runs-on : ubuntu-latest
28+ steps :
29+ - uses : actions/checkout@v4
30+
31+ - name : " Update labels"
32+ uses : micnncim/action-label-syncer@v1
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+
36+ - name : " Label pull-request"
37+ 38+ with :
39+ repo-token : ${{ secrets.GITHUB_TOKEN }}
40+
41+ branch-name-style :
42+ name : " Branch style checks"
43+ runs-on : ubuntu-latest
44+ needs : labeler
45+ steps :
46+ - uses : ansys/actions/branch-name-style@v5
47+
48+ code-style :
49+ name : " Code style checks"
50+ runs-on : ubuntu-latest
51+ needs : branch-name-style
52+ steps :
53+ - uses : ansys/actions/code-style@v5
54+ with :
55+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
56+
57+ doc-style :
58+ name : " Doc style checks"
59+ runs-on : ubuntu-latest
60+ needs : branch-name-style
61+ steps :
62+ - uses : ansys/actions/doc-style@v5
63+ with :
64+ token : ${{ secrets.GITHUB_TOKEN }}
6565
6666 doc-build :
6767 name : " Doc build"
6868 runs-on : [self-hosted, pystk]
69- # needs: doc-style
69+ needs : doc-style
7070 timeout-minutes : 30
7171 steps :
7272
@@ -193,120 +193,120 @@ jobs:
193193 docker logs ${{ env.STK_CONTAINER }}
194194 docker rm ${{ env.STK_CONTAINER }}
195195
196- # tests:
197- # name: "Tests Python ${{ matrix.python }}"
198- # runs-on: [self-hosted, pystk]
199- # needs: code-style
200- # strategy:
201- # matrix:
202- # # Tests run against Python 3.8 to ensure backwards compatibility with
203- # # the lowest supported Python version. Testing against a single version
204- # # minimizes the time for CI/CD runs.
205- # #
206- # # Can not use ${{ env.MINIMUM_PYTHON_VERSION }} because GitHub actions
207- # # does not support ENV variable substitution in matrix definition
208- # python: ['3.8']
209- # fail-fast: false
210- # steps:
211- #
212- # - name: "Checkout the project"
213- # uses: actions/checkout@v4
214- #
215- # - name: "Generate the name of the docker image and the container"
216- # run: |
217- # python_image_name=${{ env.STK_DOCKER_IMAGE }}-python${{ matrix.python }}
218- # container_name=stk-python${{ matrix.python }}
219- # echo "STK_PYTHON_IMAGE=$python_image_name" >> $GITHUB_ENV
220- # echo "STK_CONTAINER=$container_name" >> $GITHUB_ENV
221- #
222- # - name: "Start the container from the desired image"
223- # run: |
224- # docker run \
225- # --detach -it \
226- # --network="host" \
227- # --name ${{ env.STK_CONTAINER }} \
228- # --env ANSYSLMD_LICENSE_FILE=${{ env.LICENSE_SERVER_PORT }}@${{ secrets.LICENSE_SERVER }} \
229- # --volume ${PWD}:/home/stk/pystk \
230- # ${{ env.STK_PYTHON_IMAGE }}
231- #
232- # - name: "Install the project with the testing dependencies"
233- # run: |
234- # docker exec \
235- # --workdir ${{ env.PYSTK_DIR }} \
236- # ${{ env.STK_CONTAINER }} /bin/bash -c \
237- # "python -m pip install tox && rm -rf .tox"
238- #
239- # - name: "Run the aviator tests"
240- # run: |
241- # docker exec \
242- # --workdir ${{ env.PYSTK_DIR }} \
243- # ${{ env.STK_CONTAINER }} /bin/bash -c \
244- # "export COVERAGE_FILE=aviator && tox -e tests-aviator-graphics-cov-linux"
245- #
246- # - name: "Run the non graphics stk tests"
247- # run: |
248- # docker exec \
249- # --workdir ${{ env.PYSTK_DIR }} \
250- # ${{ env.STK_CONTAINER }} /bin/bash -c \
251- # "export COVERAGE_FILE=stknogfx && tox -e tests-stk-nographics-cov-linux"
252- #
253- # - name: "Run the graphics only stk tests"
254- # run: |
255- # docker exec \
256- # --workdir ${{ env.PYSTK_DIR }} \
257- # ${{ env.STK_CONTAINER }} /bin/bash -c \
258- # "export COVERAGE_FILE=stkgfx && tox -e tests-stk-graphicsonly-cov-linux"
259- #
260- # - name: "Run the vgt tests"
261- # run: |
262- # docker exec \
263- # --workdir ${{ env.PYSTK_DIR }} \
264- # ${{ env.STK_CONTAINER }} /bin/bash -c \
265- # "export COVERAGE_FILE=vgt && tox -e tests-vgt-graphics-cov-linux"
266- #
267- # - name: "Install coverage dependencies"
268- # if: ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
269- # run: |
270- # docker exec \
271- # --workdir ${{ env.PYSTK_DIR }} \
272- # ${{ env.STK_CONTAINER }} /bin/bash -c \
273- # "python -m pip install .[tests]"
274- #
275- # - name: "Combine all coverage results"
276- # if: ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
277- # run: |
278- # docker exec \
279- # --workdir ${{ env.PYSTK_DIR }} \
280- # ${{ env.STK_CONTAINER }} /bin/bash -c \
281- # "coverage combine aviator stknogfx stkgfx vgt"
282- #
283- # - name: "Generate total coverage report"
284- # if: ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
285- # run: |
286- # docker exec \
287- # --workdir ${{ env.PYSTK_DIR }} \
288- # ${{ env.STK_CONTAINER }} /bin/bash -c \
289- # "coverage html -d .cov/total-html"
290- #
291- # - name: "Upload coverage results"
292- # if: ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
293- # uses: actions/upload-artifact@v4
294- # with:
295- # path: .cov/total-html
296- # name: html-coverage
297- #
298- # - name: "Stop the container"
299- # if: always()
300- # run: |
301- # docker stop ${{ env.STK_CONTAINER }}
302- # docker logs ${{ env.STK_CONTAINER }}
303- # docker rm ${{ env.STK_CONTAINER }}
304- #
305- # build-library:
306- # name: "Build library"
307- # runs-on: ubuntu-latest
308- # needs: [doc-build, tests]
309- # steps:
310- # - uses: ansys/actions/build-library@v5
311- # with:
312- # library-name: ${{ env.LIBRARY_NAME }}
196+ tests :
197+ name : " Tests Python ${{ matrix.python }}"
198+ runs-on : [self-hosted, pystk]
199+ needs : code-style
200+ strategy :
201+ matrix :
202+ # Tests run against Python 3.8 to ensure backwards compatibility with
203+ # the lowest supported Python version. Testing against a single version
204+ # minimizes the time for CI/CD runs.
205+ #
206+ # Can not use ${{ env.MINIMUM_PYTHON_VERSION }} because GitHub actions
207+ # does not support ENV variable substitution in matrix definition
208+ python : ['3.8']
209+ fail-fast : false
210+ steps :
211+
212+ - name : " Checkout the project"
213+ uses : actions/checkout@v4
214+
215+ - name : " Generate the name of the docker image and the container"
216+ run : |
217+ python_image_name=${{ env.STK_DOCKER_IMAGE }}-python${{ matrix.python }}
218+ container_name=stk-python${{ matrix.python }}
219+ echo "STK_PYTHON_IMAGE=$python_image_name" >> $GITHUB_ENV
220+ echo "STK_CONTAINER=$container_name" >> $GITHUB_ENV
221+
222+ - name : " Start the container from the desired image"
223+ run : |
224+ docker run \
225+ --detach -it \
226+ --network="host" \
227+ --name ${{ env.STK_CONTAINER }} \
228+ --env ANSYSLMD_LICENSE_FILE=${{ env.LICENSE_SERVER_PORT }}@${{ secrets.LICENSE_SERVER }} \
229+ --volume ${PWD}:/home/stk/pystk \
230+ ${{ env.STK_PYTHON_IMAGE }}
231+
232+ - name : " Install the project with the testing dependencies"
233+ run : |
234+ docker exec \
235+ --workdir ${{ env.PYSTK_DIR }} \
236+ ${{ env.STK_CONTAINER }} /bin/bash -c \
237+ "python -m pip install tox && rm -rf .tox"
238+
239+ - name : " Run the aviator tests"
240+ run : |
241+ docker exec \
242+ --workdir ${{ env.PYSTK_DIR }} \
243+ ${{ env.STK_CONTAINER }} /bin/bash -c \
244+ "export COVERAGE_FILE=aviator && tox -e tests-aviator-graphics-cov-linux"
245+
246+ - name : " Run the non graphics stk tests"
247+ run : |
248+ docker exec \
249+ --workdir ${{ env.PYSTK_DIR }} \
250+ ${{ env.STK_CONTAINER }} /bin/bash -c \
251+ "export COVERAGE_FILE=stknogfx && tox -e tests-stk-nographics-cov-linux"
252+
253+ - name : " Run the graphics only stk tests"
254+ run : |
255+ docker exec \
256+ --workdir ${{ env.PYSTK_DIR }} \
257+ ${{ env.STK_CONTAINER }} /bin/bash -c \
258+ "export COVERAGE_FILE=stkgfx && tox -e tests-stk-graphicsonly-cov-linux"
259+
260+ - name : " Run the vgt tests"
261+ run : |
262+ docker exec \
263+ --workdir ${{ env.PYSTK_DIR }} \
264+ ${{ env.STK_CONTAINER }} /bin/bash -c \
265+ "export COVERAGE_FILE=vgt && tox -e tests-vgt-graphics-cov-linux"
266+
267+ - name : " Install coverage dependencies"
268+ if : ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
269+ run : |
270+ docker exec \
271+ --workdir ${{ env.PYSTK_DIR }} \
272+ ${{ env.STK_CONTAINER }} /bin/bash -c \
273+ "python -m pip install .[tests]"
274+
275+ - name : " Combine all coverage results"
276+ if : ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
277+ run : |
278+ docker exec \
279+ --workdir ${{ env.PYSTK_DIR }} \
280+ ${{ env.STK_CONTAINER }} /bin/bash -c \
281+ "coverage combine aviator stknogfx stkgfx vgt"
282+
283+ - name : " Generate total coverage report"
284+ if : ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
285+ run : |
286+ docker exec \
287+ --workdir ${{ env.PYSTK_DIR }} \
288+ ${{ env.STK_CONTAINER }} /bin/bash -c \
289+ "coverage html -d .cov/total-html"
290+
291+ - name : " Upload coverage results"
292+ if : ${{ matrix.python == env.MINIMUM_PYTHON_VERSION }}
293+ uses : actions/upload-artifact@v4
294+ with :
295+ path : .cov/total-html
296+ name : html-coverage
297+
298+ - name : " Stop the container"
299+ if : always()
300+ run : |
301+ docker stop ${{ env.STK_CONTAINER }}
302+ docker logs ${{ env.STK_CONTAINER }}
303+ docker rm ${{ env.STK_CONTAINER }}
304+
305+ build-library :
306+ name : " Build library"
307+ runs-on : ubuntu-latest
308+ needs : [doc-build, tests]
309+ steps :
310+ - uses : ansys/actions/build-library@v5
311+ with :
312+ library-name : ${{ env.LIBRARY_NAME }}
0 commit comments