Skip to content

Commit 77ffca3

Browse files
committed
Add windows build to CI
1 parent 158aa22 commit 77ffca3

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

.github/workflows/ci.yml

+80-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,86 @@ on:
1414
type: string
1515

1616
jobs:
17-
ubuntu-latest:
17+
Win64:
18+
runs-on: windows-latest
19+
strategy:
20+
fail-fast: true
21+
env:
22+
BASE_DIR: ${{ github.workspace }}
23+
SRC_DIR: ${{ github.workspace }}/src
24+
BUILD_DIR: ${{ github.workspace }}/build
25+
INSTALL_PREFIX: ${{ github.workspace }}/cadet
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
submodules: true
30+
path: src
31+
ref: ${{ github.event.inputs.ref || github.ref }}
32+
- uses: ilammy/msvc-dev-cmd@v1
33+
- name: Get MSVC version
34+
id: get-msvc
35+
run: |
36+
$MSVC_VERSION = cl 2>&1 | Select-String -Pattern 'Version (\d\d\.\d\d)' | % { $_.matches.groups[1].Value }
37+
echo "version=$MSVC_VERSION" >> $Env:GITHUB_OUTPUT
38+
- uses: actions/cache@v4
39+
id: cache
40+
with:
41+
path: |
42+
${{ github.workspace }}/hdf5
43+
${{ github.workspace }}/eigen/install
44+
${{ github.workspace }}/gmp
45+
${{ github.workspace }}/mpfr
46+
${{ github.workspace }}/mpc
47+
key: ${{ runner.os }}-deps-${{ steps.get-msvc.outputs.version }}-1
48+
- name: Build HDF5 and Eigen3
49+
if: steps.cache.outputs.cache-hit != 'true'
50+
run: |
51+
$base_dir = $($env:BASE_DIR.Replace('\', '/'))
52+
53+
# Build HDF5
54+
Invoke-WebRequest -Uri "https://www.hdfgroup.org/package/cmake-hdf5-1-14-0-zip/?wpdmdl=17553" -OutFile hdf5.zip
55+
7z x hdf5.zip
56+
cd CMake-hdf5-1.14.0
57+
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_ENABLE_F2003:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH="${base_dir}/hdf5" -DCTEST_CONFIGURATION_TYPE:STRING=Release -DBUILD_TESTING=ON -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_BUILD_HL_LIB=OFF -DHDF5_BUILD_CPP_LIB=OFF -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH="${base_dir}/CMake-hdf5-1.14.0" -DHDF5_PACKAGE_EXTLIBS:BOOL=ON -DSITE:STRING=WIN10VS202264.XXXX -DBUILDNAME:STRING=Windows-WIN10-vs2022-STATIC -G "Ninja" hdf5-1.14.0
58+
ninja install
59+
cd "${env:BASE_DIR}"
60+
61+
# Build GMP
62+
Invoke-WebRequest -Uri "https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz" -OutFile gmp.tar.lz
63+
7z x gmp.tar.lz
64+
cd gmp-6.2.1
65+
./configure --prefix="${base_dir}/gmp"
66+
make
67+
make install
68+
cd "${env:BASE_DIR}"
69+
70+
# Build MPFR
71+
Invoke-WebRequest -Uri "https://www.mpfr.org/mpfr-current/mpfr-4.1.0.tar.gz" -OutFile mpfr.tar.gz
72+
7z x mpfr.tar.gz
73+
cd mpfr-4.1.0
74+
./configure --prefix="${base_dir}/mpfr" --with-gmp="${base_dir}/gmp"
75+
make
76+
make install
77+
cd "${env:BASE_DIR}"
78+
79+
# Build MPC
80+
Invoke-WebRequest -Uri "https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz" -OutFile mpc.tar.gz
81+
7z x mpc.tar.gz
82+
cd mpc-1.2.1
83+
./configure --prefix="${base_dir}/mpc" --with-gmp="${base_dir}/gmp" --with-mpfr="${base_dir}/mpfr"
84+
make
85+
make install
86+
cd "${env:BASE_DIR}"
87+
88+
# Build Eigen3
89+
Invoke-WebRequest -Uri "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip" -OutFile eigen.zip
90+
7z x eigen.zip -oeigen\code -y
91+
cd eigen
92+
mkdir build
93+
cd build
94+
cmake ../code/eigen-3.4.0 -DCMAKE_INSTALL_PREFIX="../install"
95+
cmake --build . --target install
96+
Ubuntu-latest:
1897
runs-on: ubuntu-latest
1998

2099
steps:

0 commit comments

Comments
 (0)