-
Notifications
You must be signed in to change notification settings - Fork 21
194 lines (173 loc) · 6.77 KB
/
ba-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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
## ************************************************************************** ##
##
## BornAgain: simulate and fit scattering at grazing incidence
##
##! @file .github/workflows/ba-windows.yml
##! @brief GitHub runner configuration for building BornAgain under Windows
##!
##! @homepage http://www.bornagainproject.org
##! @license GNU General Public License v3 or higher (see COPYING)
##! @copyright Forschungszentrum Jülich GmbH 2020
##! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
##
## ************************************************************************** ##
##! Build scripts for GitHub Actions were introduced with BornAgain-1.17.
##! This script incorporates code by
##! - Andrew Nelson (https://github.com/reflectivity/analysis)
##! - Cristian Adam (https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/)
name: Windows
env:
CCACHE_VERSION: 3.7.7
NINJA_VERSION: 1.10.0
on:
push:
branches: [ master, develop]
paths-ignore:
- 'Doc/**'
pull_request:
branches: [ master, develop ]
paths-ignore:
- 'Doc/**'
jobs:
build:
runs-on: windows-latest
strategy:
max-parallel: 3
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: setup dependencies
shell: powershell
run: |
Get-Date -Format G
$Env:Path += ";C:\msys64\usr\bin"
cd ${{github.workspace}}
mkdir deps
Get-Date -Format G
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libboost1.73.win64.zip -O ${{runner.temp}}\libboost.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libcerf1.14.win64.zip -O ${{runner.temp}}\libcerf.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libfftw3.win64.zip -O ${{runner.temp}}\libfftw.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libgsl-static.win64.zip -O ${{runner.temp}}\libgsl.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libtiff.win64.zip -O ${{runner.temp}}\libtiff.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libyaml.win64.zip -O ${{runner.temp}}\libyaml.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/eigen3.3.7.zip -O ${{runner.temp}}\eigen.zip
Get-Date -Format G
7z x ${{runner.temp}}\libboost.zip -odeps
7z x ${{runner.temp}}\libcerf.zip -odeps
7z x ${{runner.temp}}\libfftw.zip -odeps
7z x ${{runner.temp}}\libgsl.zip -odeps
7z x ${{runner.temp}}\libtiff.zip -odeps
7z x ${{runner.temp}}\libyaml.zip -odeps
7z x ${{runner.temp}}\eigen.zip -odeps
Get-Date -Format G
dir deps
dir deps/include
dir deps/lib
- name: Install Python packages
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy matplotlib
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
dir: '${{ github.workspace }}/qt5/'
install-deps: 'true'
mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
modules: 'qtcharts qtwebengine'
cached: 'false'
- name: Download ccache, Ninja, Nsis
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v$ENV{NINJA_VERSION}/ninja-win.zip")
file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip)
set(nsis_url "https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04.zip")
file(DOWNLOAD "${nsis_url}" ./nsis.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./nsis.zip)
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files for BornAgain
uses: actions/[email protected]
with:
path: .ccache
key: ba-windows-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ba-windows-ccache-
- name: Build BornAgain
shell: cmd
env:
CCACHE_BASEDIR: $GITHUB_WORKSPACE
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "1000M"
run: |
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
set OPTLIBS=${{github.workspace}}\deps
set EIGENDIR=${{github.workspace}}\eigen\eigen-3.3.7
set QTDIR=${{github.workspace}}\qt5\Qt\5.15.2\msvc2019_64
set PATH=${{github.workspace}};%OPTLIBS%\lib;%QTDIR%\bin;%PATH%
cd ${{github.workspace}}
dir
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_INCLUDE_PATH=%OPTLIBS%/include -DCMAKE_LIBRARY_PATH=%OPTLIBS%/lib -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ..
ccache -z
ccache -p
cmake --build . --config Release -j4
- name: Testing
shell: cmd
run: |
echo %QTDIR%
echo %OPTLIBS%
set OPTLIBS=${{github.workspace}}\deps
set PATH=%OPTLIBS%\lib;%QTDIR%\bin;%PATH%
echo %PATH%
cd ${{github.workspace}}\build
ccache -s
ctest -LE Fullcheck --output-on-failure
- name: Upload test logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: LastTest.log
path: ./build/Testing/Temporary/LastTest.log
- name: Build package
if: success()
shell: cmd
run: |
cd ${{github.workspace}}\build
set PATH=${{github.workspace}}\nsis-3.04;%PATH%
cpack --debug -c Release
- name: Upload CPack log
uses: actions/upload-artifact@v2
if: failure()
with:
name: CPack.log
path: ./build/_CPack_Packages/win64/NSIS/NSISOutput.log
- name: Upload package
uses: actions/upload-artifact@v2
if: success()
with:
name: BornAgainWinInstaller
path: ./build/BornAgain-*.exe