-
Notifications
You must be signed in to change notification settings - Fork 154
171 lines (139 loc) · 5.43 KB
/
build_mmvii.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
name: Build MMVII Linux/Windows
on:
push:
branches:
- 'master'
jobs:
build_linux:
if: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt and clang
run: |
sudo apt update
sudo apt install qtbase5-dev clang-14
- name: Install libproj
run: sudo apt install libproj-dev proj-data
- name: Install pdflatex
run: sudo apt install texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-science
- name: Build MMVII documentation
run: make -C MMVII/Doc a4
- name: Remove previous MMVII documentation release
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: true
run: gh release delete MMVII_Documentation -y --cleanup-tag
- name: Upload MMVII documentaion
uses: softprops/action-gh-release@v2
with:
name: 'MMVII Documentation - Latest'
tag_name: MMVII_Documentation
make_latest: false
token: ${{ secrets.GITHUB_TOKEN }}
files: MMVII/Doc/Doc2007_a4.pdf
- name: Configure CMake for mm3d
run: cmake -B build -DWITH_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_QT5=ON
- name: Cache mm3d build
id: cache-mm3d-linux
uses: actions/cache@v4
with:
path: |
lib/libelise.a
lib/libANN.a
bin/mm3d
key: ${{ runner.os }}-build-mm3d-${{ hashFiles('src/**/*.cpp','src/**/*.h','include/**/*.h','!src/util/GIT_defines.cpp') }}
- if: ${{ steps.cache-mm3d-linux.outputs.cache-hit != 'true' }}
name: Build elise.lib and mm3d
run: make -C build install -j 4
- name: Configure CMake for MMVII
run: cmake -S MMVII -B MMVII/build -DCMAKE_BUILD_TYPE=Release
env:
CXX: clang++-14
CC: clang-14
- name: Build MMVII
run: cmake --build MMVII/build -j 4 --target full -- -k
- name: Run MMVII Tests
working-directory: ./MMVII/bin
run: ./MMVII Bench 1
build_win:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
- name: Install PROJ with miniconda
run: conda install -y proj
if: steps.cache-conda-gdal.outputs.cache-hit != 'true'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
- name: Configure CMake for mm3d
run: cmake -B build -DWITH_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_QT5=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}
- name: Cache mm3d build
id: cache-mm3d-windows
uses: actions/cache@v4
with:
path: |
lib/elise.lib
lib/ANN.lib
bin/*
key: ${{ runner.os }}-build-mm3d-${{ hashFiles('src/**/*.cpp','src/**/*.h','include/**/*.h','!src/util/GIT_defines.cpp') }}
- if: ${{ steps.cache-mm3d-windows.outputs.cache-hit != 'true' }}
name: Build elise.lib and mm3d
run: cmake --build build --config Release --target INSTALL -j 4
- name: Force save mm3d build cache
uses: actions/cache/save@v3
if: always()
with:
path: |
lib/elise.lib
lib/ANN.lib
bin/*
key: ${{ runner.os }}-build-mm3d-${{ hashFiles('src/**/*.cpp','src/**/*.h','include/**/*.h','!src/util/GIT_defines.cpp') }}
- name: Configure CMake for MMVII
run: cmake -S MMVII -B MMVII/build -DCMAKE_PREFIX_PATH=C:/Miniconda/envs/test/Library
- name: Build MMVII
run: cmake --build MMVII/build --config Release -j 4 --target full
- name: Run MMVII Tests
working-directory: ./MMVII/bin
run: ./MMVII Bench 1
- name: Package
shell: bash
run: |
rm -fr MMVII/bin/Makefile* MMVII/bin/*.makefile MMVII/bin/MMVII-* MMVII/bin/P2007.lib MMVII/MMVII-TestDir/Tmp/
mkdir -p micmac/include micmac/MMVII
cp -a bin/ binaire-aux/ micmac/
cp -a include/XML_MicMac include/XML_GEN/ include/qt micmac/include/
cp -a MMVII/MMVII-LocalParameters/ MMVII/MMVII-RessourceDir/ MMVII/MMVII-TestDir/ MMVII/bin/ MMVII/share/ micmac/MMVII/
mkdir -p micmac/bin/platforms micmac/bin/imageformats micmac/MMVII/bin/platforms
MMVII_BINDIR=$(pwd)/micmac/MMVII/bin
MM3D_BINDIR=$(pwd)/micmac/bin
cp ${Qt5_Dir}/plugins/platforms/qwindows.dll ${MMVII_BINDIR}/platforms/
cd /C/Miniconda/envs/test/Library/bin/
cp deflate.dll Lerc.dll libcrypto-3-x64.dll libcurl.dll liblzma.dll libssh2.dll proj_9_3.dll sqlite3.dll tiff.dll zlib.dll zstd.dll ${MMVII_BINDIR}/
cd $Qt5_Dir/bin
cp Qt5Core.dll Qt5Gui.dll Qt5Xml.dll Qt5OpenGL.dll Qt5Widgets.dll ${MM3D_BINDIR}/
cd $Qt5_Dir/plugins
cp platforms/qwindows.dll ${MM3D_BINDIR}/platforms/
cp imageformats/*.dll ${MM3D_BINDIR}/imageformats/
cd $GITHUB_WORKSPACE
- name: Create Zip
run: 7z a mmvii_windows.zip micmac
- name: Remove previous Windows MMVII build release
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: true
run: gh release delete Windows_MMVII_build -y --cleanup-tag
- name: Upload binaries to release
uses: softprops/action-gh-release@v2
with:
name: 'Windows MMVII build - Latest'
tag_name: Windows_MMVII_build
make_latest: false
token: ${{ secrets.GITHUB_TOKEN }}
files: mmvii_windows.zip