Skip to content

Revert.

Revert. #647

Workflow file for this run

name: Windows build
on:
push:
branches:
- "**"
# tags:
# - "v*"
# pull_request:
# branches:
# - main
# merge_group:
# branches:
# - main
workflow_dispatch:
jobs:
windows-build:
name: Windows vcpkg build
runs-on: windows-latest
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install UFL
run: pip install git+https://github.com/FEniCS/ufl.git
- name: Checkout Basix
uses: actions/checkout@v4
with:
repository: "fenics/basix"
path: basix
- name: Insert add_dll_directory calls into Basix
working-directory: basix/python/basix
run: |
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("${{ github.workspace }}/basix-install/bin")') | Set-Content __init__.py
Get-Content __init__.py
- name: Set up CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.30.0"
- name: Install Basix (C++)
working-directory: basix/cpp
run: |
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -B build-dir -S .
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix "$env:GITHUB_WORKSPACE/basix-install"
echo "D:/a/dolfinx/basix-install/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install build dependencies (workaround)
run: |
python -m pip install scikit-build-core[pyproject] setuptools wheel nanobind
- name: Install Basix (Python)
working-directory: basix/python
run: |
python -m pip -v install --check-build-dependencies --no-build-isolation --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR="$env:GITHUB_WORKSPACE/basix-install/lib/cmake/basix"
- name: Checkout FFCx
uses: actions/checkout@v4
with:
repository: "fenics/ffcx"
path: ffcx
- name: Install UFCx header
working-directory: ffcx
run: |
cmake -B build-dir -S cmake/
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix "$env:GITHUB_WORKSPACE/ufcx-install"
- name: Install FFCx
working-directory: ffcx
run: |
pip install .
- name: Checkout DOLFINx
uses: actions/checkout@v4
with:
path: dolfinx
- name: Insert add_dll_directory calls into DOLFINx
working-directory: dolfinx/python/dolfinx
run: |
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("${{ github.workspace }}/dolfinx-install/bin"); os.add_dll_directory("C:/Program Files (x86)/Intel/oneAPI/mpi/2021.12/opt/mpi/libfabric/bin")') | Set-Content __init__.py
Get-Content __init__.py
- uses: mpi4py/[email protected]
with:
mpi: "intelmpi"
- name: Install DOLFINx (C++)
working-directory: dolfinx
run: |
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DDOLFINX_BASIX_PYTHON=OFF -DBasix_DIR="$env:GITHUB_WORKSPACE/basix-install/lib/cmake/basix" -DDOLFINX_UFCX_PYTHON=OFF -Dufcx_DIR="$env:GITHUB_WORKSPACE/ufcx-install/share/ufcx/cmake" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_OVERLAY_PORTS="cpp/.vcpkg-overlay" -B build-dir -S cpp
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix D:/a/dolfinx/dolfinx-install
echo "D:/a/dolfinx/dolfinx-install/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Build unit tests (C++)
working-directory: dolfinx
run: |
cmake -DBasix_DIR=D:/a/dolfinx/basix-install/share/basix -Dufcx_DIR="$env:GITHUB_WORKSPACE/ufcx-install/share/ufcx/cmake" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -B build/test/ -S cpp/test/
cmake --build build/test --config Release --parallel 3
- name: Run unit tests (C++, MPI, np=1)
working-directory: dolfinx/build/test
run: |
mpiexec -n 1 ctest -V --output-on-failure -R unittests
- name: Run C++ tests (C++, MPI, np=3)
working-directory: dolfinx/build/test
run: |
mpiexec -n 3 ctest -V --output-on-failure -R unittests
- name: Install build dependencies
working-directory: dolfinx
run: |
pip -v install --no-binary mpi4py -r "mpi4py<4"
- name: Install DOLFINx (Python)
working-directory: dolfinx/python
run: |
pip -v install --check-build-dependencies --no-build-isolation .[test] --config-settings=cmake.args=-DBasix_DIR="$env:GITHUB_WORKSPACE/basix-install/lib/cmake/basix" --config-settings=cmake.args=-Dufcx_DIR="$env:GITHUB_WORKSPACE/ufcx-install/share/ufcx/cmake" --config-settings=cmake.args=-DDOLFINX_DIR="$env:GITHUB_WORKSPACE/dolfinx-install/lib/cmake/dolfinx" --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
- name: Run units tests (Python, serial)
working-directory: dolfinx
run: |
pip install pytest-xdist
python -m pytest -n auto -m "not petsc4py and not adios2" python/test/unit
- name: Run units tests (Python, MPI, np=3)
working-directory: dolfinx
run: |
mpiexec -n 3 python -m pytest -m "not petsc4py and not adios2" python/test/unit
- name: Run Python demos (serial)
working-directory: dolfinx/python/demo
run: |
python3 -m pytest -n auto -m serial --durations=10 test.py
- name: Run Python demos (MPI, np=3)
working-directory: dolfinx/python/demo
run: |
python3 -m pytest -m mpi --num-proc=3 test.py