-
Notifications
You must be signed in to change notification settings - Fork 25
219 lines (214 loc) · 7.62 KB
/
rapcad.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: RapCAD
on:
push:
branches: [master, development]
tags: v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches: [master, development]
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
config: ['coverage', 'official']
shouldRelease:
- ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
exclude:
- shouldRelease: false
config: official
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Qt Directory
run: |
sudo mkdir /usr/Qt
sudo chown $(whoami) /usr/Qt
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
with:
path: /usr/Qt
key: ${{ runner.os }}-QtCache-6
- name: Install Qt
uses: jurplel/install-qt-action@v3.0.0
with:
version: '6.5.*'
dir: /usr
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Install Dependencies
run: sudo apt-get install -y libboost-dev libcgal-dev libglu1-mesa-dev libxkbcommon-x11-0 libxcb-cursor0
- name: Configure
run: qmake CONFIG+=${{ matrix.config }}
- name: Build
run: make -j4
- name: Test
if: ${{ matrix.config == 'coverage' }}
run: xvfb-run --server-args="-screen 0 1024x768x24" ./rapcad -t test
- name: Coverage
if: ${{ matrix.config == 'coverage' }}
run: find . -type f -name '*.gcno' -exec gcov -p -r {} +
- name: Upload Coverage
if: ${{ matrix.config == 'coverage' }}
uses: codecov/codecov-action@v3
windows:
runs-on: windows-latest
strategy:
matrix:
config: ['coverage', 'official']
shouldRelease:
- ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
exclude:
- shouldRelease: false
config: official
env:
CGAL_DIR: C:\CGAL-5.4\
GMP: C:\CGAL-5.4\auxiliary\gmp
BOOST_ROOT: C:\boost_1_80_0
ASCIIDOC: C:\asciidoc-9.1.0\
MINGW: C:\mingw64\bin
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Boost
run: |
Invoke-WebRequest "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.7z" -OutFile "$env:TEMP\boost.7z"
7z x -oC:\ "$env:TEMP\boost.7z"
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-6
- name: Install Qt
uses: jurplel/install-qt-action@v3.0.0
with:
version: '6.5.*'
cache: ${{ steps.cache-qt.outputs.cache-hit }}
arch: win64_mingw
- name: Install Flex/Bison
if: ${{ !steps.cache-qt.outputs.cache-hit }}
run: |
Invoke-WebRequest /~https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip -OutFile "$env:TEMP\FlexBison.zip"
7z x -o"$env:Qt6_DIR\bin" "$env:TEMP\FlexBison.zip" -aoa
- name: Install CGAL
run: |
Invoke-WebRequest /~https://github.com/CGAL/cgal/releases/download/v5.4/CGAL-5.4.zip -OutFile "$env:TEMP\CGAL-release.zip"
7z x -oC:\ "$env:TEMP\CGAL-release.zip"
- name: Install GMP/MPFR
run: |
Invoke-WebRequest /~https://github.com/CGAL/cgal/releases/download/v5.4/CGAL-5.4-win64-auxiliary-libraries-gmp-mpfr.zip -OutFile "$env:TEMP\CGAL-gmp-mpfr.zip"
7z x -o"$env:CGAL_DIR" "$env:TEMP\CGAL-gmp-mpfr.zip" -aoa
- name: Install asciidoc/source-highlight
if: ${{ matrix.config == 'official' }}
run: |
Invoke-WebRequest /~https://github.com/asciidoc-py/asciidoc-py/releases/download/9.1.0/asciidoc-9.1.0.zip -OutFile "$env:TEMP\asciidoc.zip"
7z x -oC:\ "$env:TEMP\asciidoc.zip"
Invoke-WebRequest -UserAgent "Wget" https://downloads.sourceforge.net/project/gnuwin32/src-highlite/2.1.2/src-highlite-2.1.2-bin.zip -OutFile "$env:TEMP\src-highlite.zip"
7z x -oC:\source-highlight "$env:TEMP\src-highlite.zip"
mv C:\source-highlight\bin\source-highlight.exe C:\source-highlight\bin\source-highlight-exe.exe
cp scripts\source-highlight.bat C:\source-highlight\bin
Invoke-WebRequest https://www.gnu.org/software/src-highlite/lang_files/csharp.lang -OutFile csharp.lang
cp csharp.lang C:\source-highlight\share\source-highlight
echo "`ncsharp = csharp.lang" >> C:\source-highlight\share\source-highlight\lang.map
echo "C:\source-highlight\bin" >> $env:GITHUB_PATH
- name: Configure pagefile
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Configure
run: |
echo "VERSION=$(cat VERSION)" >> $env:GITHUB_ENV
qmake CONFIG+=${{ matrix.config }}
rm VERSION
touch version
- name: Build
run: mingw32-make -j4 -f Makefile.Release
- name: Clean
run: mingw32-make clean -f Makefile.Release
- name: Build documentation
if: ${{ matrix.config == 'official' }}
run: |
mingw32-make user_guide.html -f Makefile.Release
cp user_guide.html release
- name: Package
run: |
cp "$env:GMP\lib\libgmp-10.dll" release
cp "$env:GMP\lib\libmpfr-4.dll" release
windeployqt --no-svg --no-translations release\rapcad.exe
cp "$env:MINGW\libgcc_s_seh-1.dll" release
cp "$env:MINGW\libstdc++-6.dll" release
cp "$env:MINGW\libwinpthread-1.dll" release
- name: Build installer
if: ${{ matrix.config == 'official' }}
run: |
rm -Recurse release\imageformats
makensis installer.nsi
mv rapcad_setup.exe "rapcad_$($env:VERSION)_setup.exe"
mv release "rapcad_$env:VERSION"
7z a -tzip "rapcad_$env:VERSION.zip" "rapcad_$env:VERSION"
- name: Test
if: ${{ matrix.config == 'coverage' }}
run: .\release\rapcad.exe -t test
- name: Store
if: ${{ matrix.config == 'official' }}
uses: actions/upload-artifact@v3
with:
name: windows-artifacts
path: |
rapcad_*.exe
rapcad_*.zip
macos:
runs-on: macos-latest
strategy:
matrix:
config: ['coverage', 'official']
shouldRelease:
- ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
exclude:
- shouldRelease: false
config: official
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-6
- name: Install Qt
uses: jurplel/install-qt-action@v3.0.0
with:
version: '6.5.*'
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Install Dependencies
run: |
brew install cgal bison
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "BOOST_ROOT=$(brew --prefix boost)" >> $GITHUB_ENV
echo "CGAL_DIR=$(brew --prefix cgal)" >> $GITHUB_ENV
echo "GMP=$(brew --prefix gmp)" >> $GITHUB_ENV
echo "MPFR=$(brew --prefix mpfr)" >> $GITHUB_ENV
- name: Configure
run: |
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
qmake CONFIG+=${{ matrix.config }}
rm VERSION
touch version
- name: Build
run: make -j4
- name: Package
run: |
macdeployqt rapcad.app -dmg
mv rapcad.dmg rapcad_${{ env.VERSION }}.dmg
- name: Test
if: ${{ matrix.config == 'coverage' }}
run: ./rapcad.app/Contents/MacOS/rapcad -t test
- name: Store
if: ${{ matrix.config == 'official' }}
uses: actions/upload-artifact@v3
with:
name: macos-artifacts
path: rapcad_*.dmg