Skip to content

Commit

Permalink
ci: use tox in ci (#2031)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
moe-ad authored Feb 5, 2025
1 parent 06567a3 commit acffb5f
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 194 deletions.
78 changes: 6 additions & 72 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,16 @@ jobs:
with:
python-version: ${{ inputs.python_version }}

- name: "Create virtual environment in the current workspace"
shell: pwsh
run: python -m venv .venv --system-site-packages

- name: "Update PATH for virtual environment"
run: |
echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH
- name: "Update pip to the latest version"
- name: "Update pip to the latest version and install tox"
shell: pwsh
run: |
python -m pip install -U pip
- name: "Install requirements"
shell: pwsh
run: |
python -m pip install -r requirements/requirements_build.txt
python -m pip install tox tox-uv
- name: "Build the wheel"
shell: pwsh
run: |
$os = "${{ matrix.os }}"
if ($os -eq "ubuntu-latest") {
$platform = "manylinux_2_17"
} else {
$platform = "win"
}
python .ci/build_wheel.py -p $platform -w
tox -e build-wheel
- name: "Expose the wheel"
shell: bash
Expand All @@ -111,11 +93,6 @@ jobs:
echo ${name}
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
- name: "Install package wheel"
shell: pwsh
run: |
python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
- name: "Install DPF"
id: set-server-path
uses: ansys/pydpf-actions/[email protected]
Expand All @@ -128,9 +105,9 @@ jobs:
uses: ansys/pydpf-actions/[email protected]

- name: "Test import"
shell: pwsh
working-directory: tests
shell: bash
run: |
python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}
python -c "from ansys.dpf import core"
- name: "Setup headless display"
Expand All @@ -143,53 +120,10 @@ jobs:
run: |
choco install pandoc
- name: "Install documentation packages for Python"
shell: pwsh
run: |
python -m pip install -r requirements/requirements_docs.txt
- name: "Kill all servers"
uses: ansys/pydpf-actions/[email protected]

- name: "Ensure VTK compatibility"
shell: pwsh
run: |
python -m pip uninstall --yes vtk
python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }}
- name: "List installed packages"
shell: pwsh
run: |
python -m pip list
- name: "Build HTML Documentation"
shell: cmd /D /E:ON /V:OFF /C "CALL "{0}""
working-directory: .ci
run: |
build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
timeout-minutes: 60
env:
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}

- name: "Check for success"
shell: bash
working-directory: doc
run: |
case `grep -F "build succeeded" log.txt >/dev/null; echo $?` in
0)
echo "Build succeeded!"
exit 0;;
1)
echo "Documentation generation failed, please check previous step!"
exit 1;;
*)
echo "An error occurred while checking success of the previous step!"
exit 1;;
esac
- name: "Kill all servers"
uses: ansys/pydpf-actions/[email protected]
if: always()
tox -e doc-html --installpkg dist/${{ steps.wheel.outputs.wheel_name }} -x testenv:doc-html.setenv+='VIRTUALENV_SYSTEM_SITE_PACKAGES=true'
- name: "Retrieve package version"
shell: bash
Expand Down
Loading

0 comments on commit acffb5f

Please sign in to comment.