-
-
Notifications
You must be signed in to change notification settings - Fork 34
106 lines (89 loc) · 3.34 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
name: Basix CI on Windows
on:
pull_request:
branches:
- main
push:
tags:
- "v*"
branches:
- main
merge_group:
branches:
- main
workflow_dispatch:
jobs:
build-combined:
name: Combined build and test
runs-on: windows-2022
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@v4
- 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.11"
- name: Set up CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.30.0"
- name: Install Basix (combined)
run: |
python -m pip -v install --no-cache-dir .[ci] --config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Run units tests
run: |
python -m pytest -n auto --durations 20 test/
# C++ development is not supported against combined install on Windows
- name: Run python demos
run: python -m pytest demo/python/test.py
build-split:
name: Split build and test
runs-on: windows-2022
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@v4
- name: Insert add_dll_directory calls
working-directory: python/basix
run: |
(Get-Content __init__.py).Replace('# WINDOWSDLL', 'import os; os.add_dll_directory("D:/a/basix/install/bin")') | Set-Content __init__.py
Get-Content __init__.py
- 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:
- name: Set up CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.30.0"
- name: CMake version
run: cmake --version
- name: Install Basix (C++)
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/basix/install
echo "D:/a/basix/install/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install Basix (Python)
run: |
cd python
python -m pip -v install --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR=D:/a/basix/install/lib/cmake/basix
cd ../
- name: Run units tests
run: |
python -m pytest -n auto --durations 20 test/
- name: Run C++ demos
run: python -m pytest demo/cpp/test.py --cmake-args="-DBasix_DIR=D:/a/basix/install/lib/cmake/basix"