Skip to content

Commit acffb5f

Browse files
authored
ci: use tox in ci (#2031)
* feat: documentation building * ci: test import fix * ci: add more environment variables * ci: test fix * ci: test fix * ci: test fix * ci: test fix * ci: doc.yml updated * ci: fix docs.yml * ci: tests.yml update * ci: test another fix * ci: test another fix * ci: little optimization and separating tests * ci: another fix, very moody tests * ci: ANSYS_DPF_PATH approach * ci: another fix * fix: attempting another fix * ci: another fix * ci: another fix * ci: another fix * ci: another fix * ci: another fix * ci: another fix * ci: another fix * ci: another fix * ci: avoid unnecessary windows runner tox env installation * ci: increase timeout minutes * ci: increase timeout minutes * ci: activate uv and pytest-xdist * ci: activate uv and pytest-xdist * ci: cache .tox directory * ci: modify CLI flags * ci: remove pytest-xdist * ci: trigger workflow for caches usage investigation * ci: check influence of multiple tox invocation * ci: another possible optimization * ci: another fix * ci: another test * ci: another test * ci: stable implementation * ci: larger runners testing time improvements * ci: empty commit to see caching effect * ci: run without coverage and junit * ci: run without coverage only * ci: run with pytest-cov version bumped * ci: run with pytest-cov version bumped * ci: test a fix * ci: bump coverage version * ci: remove coverage dep * ci: check if coverage is using compiled C extensions * ci: check effect of html/xml reporting * ci: use system-wide coverage/pytest-cov * ci: check influence of system wide installs * ci: effect of separate coverage file * ci: test fix * ci: update codecov action * ci: review suggestions + additional optimizations * ci: correction * ci: suppress printing report info to stdout
1 parent 06567a3 commit acffb5f

File tree

3 files changed

+164
-194
lines changed

3 files changed

+164
-194
lines changed

.github/workflows/docs.yml

+6-72
Original file line numberDiff line numberDiff line change
@@ -73,34 +73,16 @@ jobs:
7373
with:
7474
python-version: ${{ inputs.python_version }}
7575

76-
- name: "Create virtual environment in the current workspace"
77-
shell: pwsh
78-
run: python -m venv .venv --system-site-packages
79-
80-
- name: "Update PATH for virtual environment"
81-
run: |
82-
echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH
83-
84-
- name: "Update pip to the latest version"
76+
- name: "Update pip to the latest version and install tox"
8577
shell: pwsh
8678
run: |
8779
python -m pip install -U pip
88-
89-
- name: "Install requirements"
90-
shell: pwsh
91-
run: |
92-
python -m pip install -r requirements/requirements_build.txt
80+
python -m pip install tox tox-uv
9381
9482
- name: "Build the wheel"
9583
shell: pwsh
9684
run: |
97-
$os = "${{ matrix.os }}"
98-
if ($os -eq "ubuntu-latest") {
99-
$platform = "manylinux_2_17"
100-
} else {
101-
$platform = "win"
102-
}
103-
python .ci/build_wheel.py -p $platform -w
85+
tox -e build-wheel
10486
10587
- name: "Expose the wheel"
10688
shell: bash
@@ -111,11 +93,6 @@ jobs:
11193
echo ${name}
11294
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
11395
114-
- name: "Install package wheel"
115-
shell: pwsh
116-
run: |
117-
python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
118-
11996
- name: "Install DPF"
12097
id: set-server-path
12198
uses: ansys/pydpf-actions/[email protected]
@@ -128,9 +105,9 @@ jobs:
128105
uses: ansys/pydpf-actions/[email protected]
129106

130107
- name: "Test import"
131-
shell: pwsh
132-
working-directory: tests
108+
shell: bash
133109
run: |
110+
python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}
134111
python -c "from ansys.dpf import core"
135112
136113
- name: "Setup headless display"
@@ -143,53 +120,10 @@ jobs:
143120
run: |
144121
choco install pandoc
145122
146-
- name: "Install documentation packages for Python"
147-
shell: pwsh
148-
run: |
149-
python -m pip install -r requirements/requirements_docs.txt
150-
151-
- name: "Kill all servers"
152-
uses: ansys/pydpf-actions/[email protected]
153-
154-
- name: "Ensure VTK compatibility"
155-
shell: pwsh
156-
run: |
157-
python -m pip uninstall --yes vtk
158-
python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }}
159-
160-
- name: "List installed packages"
161-
shell: pwsh
162-
run: |
163-
python -m pip list
164-
165123
- name: "Build HTML Documentation"
166-
shell: cmd /D /E:ON /V:OFF /C "CALL "{0}""
167-
working-directory: .ci
168-
run: |
169-
build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
170-
timeout-minutes: 60
171-
env:
172-
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
173-
174-
- name: "Check for success"
175124
shell: bash
176-
working-directory: doc
177125
run: |
178-
case `grep -F "build succeeded" log.txt >/dev/null; echo $?` in
179-
0)
180-
echo "Build succeeded!"
181-
exit 0;;
182-
1)
183-
echo "Documentation generation failed, please check previous step!"
184-
exit 1;;
185-
*)
186-
echo "An error occurred while checking success of the previous step!"
187-
exit 1;;
188-
esac
189-
190-
- name: "Kill all servers"
191-
uses: ansys/pydpf-actions/[email protected]
192-
if: always()
126+
tox -e doc-html --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true'
193127
194128
- name: "Retrieve package version"
195129
shell: bash

0 commit comments

Comments
 (0)