-
-
Notifications
You must be signed in to change notification settings - Fork 185
160 lines (138 loc) · 6.29 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Windows build
on:
push:
branches:
- main
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("D:/a/dolfinx/basix-install/bin")') | Set-Content __init__.py
Get-Content __init__.py
- name: Install Basix (C++)
working-directory: basix
run: |
cd cpp
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -B build-dir -S .
cmake --build build-dir --config Release
cmake --install build-dir --config Release --prefix D:/a/dolfinx/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 git+https://github.com/jhale/nanobind.git@jhale/msvc2022-workaround
python -m pip install scikit-build-core[pyproject] setuptools wheel
- name: Install Basix (Python)
working-directory: basix
run: |
cd python
python -m pip -v install --check-build-dependencies --no-build-isolation --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR=D:/a/basix/install/lib/cmake/basix
cd ../
- 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 D:/a/dolfinx/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("D:/a/dolfinx/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/setup-mpi@v1.2.2
with:
mpi: "intelmpi"
- name: Install DOLFINx (C++)
working-directory: dolfinx
run: |
cmake -DINSTALL_RUNTIME_DEPENDENCIES=ON -DDOLFINX_BASIX_PYTHON=OFF -DBasix_DIR=D:/a/dolfinx/basix-install/share/basix -DDOLFINX_UFCX_PYTHON=OFF -Dufcx_DIR=D:/a/dolfinx/ufcx-install/share/ufcx/cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/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=D:/a/dolfinx/ufcx-install/share/ufcx/cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_OVERLAY_PORTS="cpp/.vcpkg-overlay" -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
run: |
cd build/test
mpiexec -n 1 ctest -V --output-on-failure -R unittests
- name: Run C++ tests (C++, MPI, np=3)
working-directory: dolfinx
run: |
cd build/test
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 python/build-requirements.txt
- name: Install DOLFINx (Python)
working-directory: dolfinx
run: |
cd python
pip -v install --check-build-dependencies --no-build-isolation .[test] --config-settings=cmake.args=-DBasix_DIR=D:/a/dolfinx/basix-install/lib/cmake/basix --config-settings=cmake.args=-Dufcx_DIR=D:/a/dolfinx/ufcx-install/share/ufcx/cmake --config-settings=cmake.args=-DDOLFINX_DIR=D:/a/dolfinx/dolfinx-install/lib/cmake/dolfinx --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake --config-settings=cmake.args=-DVCPKG_OVERLAY_PORTS="../cpp/.vcpkg-overlay"
- 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
run: |
cd python/demo
python3 -m pytest -n auto -m serial --durations=10 test.py
- name: Run Python demos (MPI, np=3)
working-directory: dolfinx
run: |
cd python/demo
python3 -m pytest -m mpi --num-proc=3 test.py