forked from Tulip-Dev/tulip
-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (144 loc) · 5.17 KB
/
windows-msvc-build.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
name: windows-msvc-build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
msvc:
name: Talipot build on Windows (MSVC)
runs-on: windows-latest
defaults:
run:
shell: cmd
env:
PYTHON_VERSION: "3.11"
CMAKE_GENERATOR: Visual Studio 17 2022
MSVC_ARCH: x64
VCPKG_INSTALL_DIR: ${{ github.workspace }}\vcpkg\installed\x64-windows-release
CLCACHE_DIR: C:/clcache
steps:
- name: Checkout Talipot code
uses: actions/checkout@v4
- name: Install MSYS2 shell
uses: msys2/setup-msys2@v2
- name: Prepare clcache timestamp
shell: msys2 {0}
id: get-current-date
run: |
echo "date=$(date -u "+%Y-%m-%d-%H-%m-%S")" >> $GITHUB_OUTPUT
- name: Cache files
uses: actions/cache@v4
with:
path: ${{ env.CLCACHE_DIR }}
key: windows-msvc-build-clcache-${{ steps.get-current-date.outputs.date }}
restore-keys: |
windows-msvc-build-clcache
save-always: true
- name: Install build dependencies with vcpkg
uses: johnwason/vcpkg-action@v6
id: vcpkg
with:
pkgs: zlib
zstd
qhull
yajl
graphviz
libgit2
cppunit
freetype
glew
fontconfig
fribidi
triplet: x64-windows-release
extra-args: --allow-unsupported --recurse
token: ${{ github.token }}
github-binarycache: true
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: "6.7.0"
host: windows
target: desktop
arch: win64_msvc2019_64
modules: qtimageformats
qtpositioning
qtwebengine
qtwebchannel
qtwebsockets
qt5compat
cache: true
- name: Install Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
id: python-install
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Install sip
run: |
set PATH=%Python3_ROOT_DIR%\Scripts:%PATH%
pip install sip
- name: Install clcache
run: |
set PATH=%Python3_ROOT_DIR%\Scripts:%PATH%
pip install scandir wheel
pip install git+https://github.com/anlambert/pyuv@master#egg=pyuv
set SETUPTOOLS_SCM_PRETEND_VERSION=v4.2.13
pip install git+https://github.com/dgehri/[email protected]#egg=clcache
- name: Create build directory
run: mkdir build
- name: Configure Talipot build with CMake
working-directory: ./build
run: |
set INCLUDE_PATH=%VCPKG_INSTALL_DIR%/include;^
%VCPKG_INSTALL_DIR%/include/graphviz
set LIBRARY_PATH=%VCPKG_INSTALL_DIR%/bin;^
%VCPKG_INSTALL_DIR%/lib
set PATH=%Python3_ROOT_DIR%\Scripts:%PATH%
cmake -G "%CMAKE_GENERATOR%"^
-A "%MSVC_ARCH%"^
-DCMAKE_INSTALL_PREFIX="C:/talipot"^
-DCMAKE_INCLUDE_PATH="%INCLUDE_PATH%"^
-DCMAKE_LIBRARY_PATH="%LIBRARY_PATH%"^
-DCMAKE_PREFIX_PATH="%QT_ROOT_DIR%"^
-DPython3_EXECUTABLE="%Python3_ROOT_DIR%/python.exe"^
-DTALIPOT_USE_QT6=ON^
-DTALIPOT_BUILD_DOC=OFF^
-DTALIPOT_BUILD_TESTS=ON ..
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Talipot build and install
working-directory: ./build
run: |
set CLCACHE_MSBUILD_CONF=/p:TrackFileAccess=false /p:CLToolExe=clcache.exe^
/p:CLToolPath=%Python3_ROOT_DIR%\Scripts
msbuild INSTALL.vcxproj /verbosity:minimal /m /p:Configuration=Release^
%CLCACHE_MSBUILD_CONF%
- name: Run Talipot unit tests
working-directory: ./build
run: |
xcopy C:\talipot\bin\msvcp* tests\plugins
xcopy C:\talipot\bin\vc* tests\plugins
xcopy C:\talipot\bin\concrt* tests\plugins
ctest --force-new-ctest-process --output-on-failure --build-config "Release"
- name: Check Talipot application can be executed
working-directory: C:/talipot/bin
run: talipot --check-application-starts --debug-plugins-load
- name: Generate Talipot NSIS installer
working-directory: ./build
run: |
set CLCACHE_MSBUILD_CONF=/p:TrackFileAccess=false /p:CLToolExe=clcache.exe^
/p:CLToolPath=%Python3_ROOT_DIR%\Scripts
msbuild bundlers/win/bundle.vcxproj /m /p:Configuration=Release %CLCACHE_MSBUILD_CONF%
- name: Upload Talipot installer to GitHub Actions artifacts
uses: actions/upload-artifact@v4
with:
name: Talipot-NSIS-installer-msvc
path: ./build/Talipot*.exe
- name: Upload Talipot bundle to dev-latest prerelease
if: github.ref == 'refs/tags/dev-latest'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Talipot development build
prerelease: true
artifacts: ./build/Talipot*.exe
token: ${{ secrets.GITHUB_TOKEN }}