forked from AMReX-Codes/amrex
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (129 loc) · 5.28 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
name: windows
on: [push, pull_request]
concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-windows
cancel-in-progress: true
jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml
# Build libamrex and all tests
tests_msvc:
name: MSVC C++17 w/o Fortran w/o MPI
runs-on: windows-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
#- name: Set Up Cache
# uses: actions/cache@v3
# with:
# path: ~/.ccache
# key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
# restore-keys: |
# ccache-${{ github.workflow }}-${{ github.job }}-git-
#- name: Install Ccache
# run: |
# Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-windows-x86_64.zip -OutFile ccache-4.8-windows-x86_64.zip
# Expand-Archive ccache-4.8-windows-x86_64.zip
- name: Build & Install
run: |
#$ccachepath = Join-Path $pwd "ccache-4.8-windows-x86_64"
#$Env:PATH += ";$ccachepath"
#$ccachecachedir = Join-Path $HOME ".ccache"
#$Env:CCACHE_DIR="$ccachecachedir"
#$Env:CCACHE_DIR
#$Env:CCACHE_COMPRESS='1'
#$Env:CCACHE_COMPRESSLEVEL='10'
#$Env:CCACHE_MAXSIZE='105M'
#ccache -z
cmake -S . -B build `
-DBUILD_SHARED_LIBS=ON `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DAMReX_EB=OFF `
-DAMReX_ENABLE_TESTS=ON `
-DAMReX_FORTRAN=OFF `
-DAMReX_MPI=OFF
#-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build --config Debug -j 4
cmake --build build --config Debug --target install
$Env:PATH += ";D:\\a\amrex\amrex\installdir\bin"
cmake --build build --config Debug --target test_install
#ccache -s
# Build libamrex and all test (static)
test_msvc_static:
name: MSVC C++17 w/o Fortran w/o MPI static
runs-on: windows-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
#- name: Set Up Cache
# uses: actions/cache@v3
# with:
# path: ~/.ccache
# key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
# restore-keys: |
# ccache-${{ github.workflow }}-${{ github.job }}-git-
#- name: Install Ccache
# run: |
# Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-windows-x86_64.zip -OutFile ccache-4.8-windows-x86_64.zip
# Expand-Archive ccache-4.8-windows-x86_64.zip
- name: Build & Install
run: |
#$ccachepath = Join-Path $pwd "ccache-4.8-windows-x86_64"
#$Env:PATH += ";$ccachepath"
#$ccachecachedir = Join-Path $HOME ".ccache"
#$Env:CCACHE_DIR="$ccachecachedir"
#$Env:CCACHE_COMPRESS='1'
#$Env:CCACHE_COMPRESSLEVEL='10'
#$Env:CCACHE_MAXSIZE='135M'
#ccache -z
# -DCMAKE_CXX_FLAGS=" /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" `
# is a workaround github windows runner 20240603.1.0.
# https://github.com/actions/runner-images/issues/10004
cmake -S . -B build `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_CXX_FLAGS=" /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" `
-DAMReX_EB=ON `
-DAMReX_ENABLE_TESTS=ON `
-DAMReX_FORTRAN=OFF `
-DAMReX_MPI=OFF
#-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build -j 4
cmake --build build --target install
cmake --build build --target test_install
#ccache -s
# Build libamrex and all tests
tests_clang:
name: MSVC Clang C++17 w/o Fortran w/o MPI
runs-on: windows-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build & Install
shell: cmd
env:
CMAKE_GENERATOR_TOOLSET: "ClangCl"
CMAKE_GENERATOR: "Visual Studio 17 2022"
run: |
# -DCMAKE_CXX_FLAGS=" /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" `
# is a workaround github windows runner 20240603.1.0.
# https://github.com/actions/runner-images/issues/10004
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
cmake -S . -B build ^
-DBUILD_SHARED_LIBS=ON ^
-DCMAKE_VERBOSE_MAKEFILE=ON ^
-DCMAKE_CXX_FLAGS=" /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" ^
-DAMReX_EB=ON ^
-DAMReX_ENABLE_TESTS=ON ^
-DAMReX_FORTRAN=OFF ^
-DAMReX_MPI=OFF ^
-DAMReX_OMP=ON
cmake --build build --config Release -j 4
cmake --build build --config Release --target install
set "PATH=%PATH%;D:\\a\amrex\amrex\installdir\bin"
cmake --build build --config Release --target test_install
# If we add ccache back, don't forget to update cleanup-cache.yml