forked from KomodoPlatform/komodo-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
361 lines (320 loc) · 14.3 KB
/
atomicdex-desktop-ci.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
name: AtomicDex-Desktop CI
on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches:
- master
schedule:
- cron: '0 0 * * 1'
env:
DEX_PROJECT_NAME: "smartdex-desktop"
DEX_DISPLAY_NAME: "SmartDEX"
DEX_COMPANY: "SmartFi"
DEX_WEBSITE: "https://smartfi.com/"
DEX_API: "mm2-smartdex"
DEX_RPCPORT: 7793
DEX_RPC: "http://127.0.0.1:7793"
jobs:
ci-flow:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
ubuntu-qt-5-15-2,
osx-qt-5-15-2,
windows-10-qt-5-15-2
]
include:
- name: ubuntu-qt-5-15-2
os: ubuntu-18.04
qt: '5.15.2'
type: 'release'
- name: osx-qt-5-15-2
os: macos-latest
qt: '5.15.2'
type: 'release'
- name: windows-10-qt-5-15-2
os: windows-latest
qt: '5.15.2'
type: 'release'
#- name: osx-qt-5-15-2-dbg
# os: macos-latest
# qt: '5.15.2'
# type: 'debug'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: 'true'
- run: git submodule update --init --recursive
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install QT (Linux)
if: runner.os == 'Linux'
uses: KomodoPlatform/install-qt-action@v2.14.0
with:
version: ${{ matrix.qt }}
setup-python: 'false'
host: 'linux'
target: 'desktop'
dir: '${{ github.workspace }}'
modules: 'qtcharts qtwidgets debug_info qtwebengine qtwebview'
aqtversion: '==0.8'
py7zrversion: '==0.6'
- name: Install QT (MacOS)
if: runner.os == 'macOS'
uses: KomodoPlatform/install-qt-action@v2.14.0
with:
version: ${{ matrix.qt }}
setup-python: 'false'
host: 'mac'
target: 'desktop'
dir: '${{ github.workspace }}'
modules: 'qtcharts qtwidgets debug_info qtwebview qtwebengine'
- name: Install QT IFW (MacOS)
if: runner.os == 'macOS'
run: |
python3 -m aqt tool mac tools_ifw 4.4.1 qt.tools.ifw.44 --outputdir ${{ github.workspace }}/Qt
echo "${{ github.workspace }}/Qt/Tools/QtInstallerFramework/4.4/bin" >> $GITHUB_PATH
- name: Install QT (Windows)
if: runner.os == 'Windows'
uses: KomodoPlatform/install-qt-action@v2.14.0
with:
version: ${{ matrix.qt }}
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
dir: 'C:\'
modules: 'qtcharts qtwidgets debug_info qtwebview qtwebengine'
- name: Install QT IFW (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
python -m aqt tool windows tools_ifw 4.4.1 qt.tools.ifw.44 --outputdir C:/Qt
echo "C:/Qt/Tools/QtInstallerFramework/4.4/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo $env:GITHUB_PATH
echo $env:PATH
- name: Install nim (Linux)
if: runner.os == 'Linux'
run: |
export DEBIAN_FRONTEND=noninteractive
export SHELL=/bin/bash
echo "CHOOSENIM_CHOOSE_VERSION=1.4.8" >> $GITHUB_ENV
export CHOOSENIM_CHOOSE_VERSION=1.4.8
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
chmod +x choosenim.sh
./choosenim.sh -y
export PATH=/home/runner/.nimble/bin:$PATH
ls /home/runner/.choosenim/toolchains
chmod +x /home/runner/.choosenim/toolchains/nim-1.4.8/bin/*
- name: Install deps (Linux)
if: runner.os == 'Linux'
run: |
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo ${{ github.sha }}
sudo ./ci_tools_atomic_dex/ci_scripts/linux_script.sh
- name: Upload env variable for vpkg (Linux)
if: runner.os == 'Linux'
run: |
#echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
#echo "LDFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "CXX=clang++-12" >> $GITHUB_ENV
echo "CC=clang-12" >> $GITHUB_ENV
- name: vcpkg deps (All)
uses: KomodoPlatform/run-vcpkg@v7
with:
vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
setupOnly: true
appendedCacheKey: ${{ hashFiles('vcpkg.json') }}
- name: Install deps (MacOS)
if: runner.os == 'macOS'
run: |
./ci_tools_atomic_dex/ci_scripts/osx_script.sh
- name: Upload env variable for vpkg (MacOS)
if: runner.os == 'macOS'
run: |
echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV
echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV
- name: Build AtomicDEX (Linux)
if: runner.os == 'Linux'
run: |
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
#export CXXFLAGS=-stdlib=libc++
#export LDFLAGS=-stdlib=libc++
export CXX=clang++-12
export CC=clang-12
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex build release
./ci_tools_atomic_dex bundle release
- name: import code signing certificates (macos)
if: runner.os == 'macOS'
uses: Apple-Actions/import-codesign-certs@v1
with:
keychain: ${{ github.run_id }}
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: import installer code signing certificates (macos)
if: runner.os == 'macOS'
uses: apple-actions/import-codesign-certs@v1
with:
keychain: ${{ github.run_id }}
keychain-password: ${{ github.run_id }}
create-keychain: false
p12-file-base64: ${{ secrets.CERTIFICATES_INSTALLER_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build AtomicDEX (MacOS)
if: runner.os == 'macOS'
run: |
export MAC_SIGN_IDENTITY="${{ secrets.MAC_SIGN_IDENTITY }}"
export INSTALLER_MAC_SIGN_IDENTITY="${{ secrets.INSTALLER_MAC_SIGN_IDENTITY }}"
export APPLE_ATOMICDEX_PASSWORD="${{ secrets.APPLE_ATOMICDEX_PASSWORD }}"
export APPLE_ID="${{ secrets.APPLE_ID }}"
export ASC_PUBLIC_ID="${{ secrets.ASC_PUBLIC_ID }}"
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export MACOSX_DEPLOYMENT_TARGET=10.13
export CC=clang
export CXX=clang++
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex bundle ${{ matrix.type }} --osx_sdk=$HOME/sdk/MacOSX10.14.sdk --compiler=clang++
- name: Build AtomicDEX (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
$Env:QT_VERSION = "${{ matrix.qt }}"
.\ci_tools_atomic_dex\ci_scripts\windows_script.ps1
- name: Running Tests (Linux)
working-directory: ci_tools_atomic_dex
if: runner.os == 'Linux' && 'KomodoPlatform/atomicDEX-Desktop' == github.repository
run: |
export REPORT_CI_TOKEN=${{ secrets.REPORT_CI_TOKEN_SECRET }}
export ATOMICDEX_TEST_SEED=${{ secrets.ATOMICDEX_TEST_SEED }}
export ATOMICDEX_PASSWORD=${{ secrets.ATOMICDEX_PASSWORD }}
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
#export CXXFLAGS=-stdlib=libc++
#export LDFLAGS=-stdlib=libc++
export CXX=clang++-12
export CC=clang-12
echo "Running tests"
./ci_tools_atomic_dex tests release
cd build-Release/bin/AntaraAtomicDexTestsAppDir/usr/bin
cat ${{ env.DEX_PROJECT_NAME }}-tests-result.xml
#curl https://report.ci/upload.py --output upload.py
ls
#python upload.py --sha `git rev-parse HEAD` -n "[Doctest Linux]" --include='${{ env.DEX_PROJECT_NAME }}-tests-result.xml' --framework=doctest --merge ".*"
#echo "Uploading tests on Linux finished"
- name: Running Tests (MacOS)
working-directory: ci_tools_atomic_dex
if: runner.os == 'macOS' && 'KomodoPlatform/atomicDEX-Desktop' == github.repository
run: |
export REPORT_CI_TOKEN=${{ secrets.REPORT_CI_TOKEN_SECRET }}
export ATOMICDEX_TEST_SEED=${{ secrets.ATOMICDEX_TEST_SEED }}
export ATOMICDEX_PASSWORD=${{ secrets.ATOMICDEX_PASSWORD }}
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export CC=clang
export CXX=clang++
echo "Running tests"
#./ci_tools_atomic_dex tests ${{ matrix.type }}
#cd build-${{ matrix.type }}/bin/${{ env.DEX_PROJECT_NAME }}_tests.app/Contents/MacOS
#cat ${{ env.DEX_PROJECT_NAME }}-tests-result.xml
#curl https://report.ci/upload.py --output upload.py
ls
#python upload.py --sha `git rev-parse HEAD` -n "[Doctest MacOS ${{ matrix.type }}]" --include='${{ env.DEX_PROJECT_NAME }}-tests-result.xml' --framework=doctest --merge ".*"
#echo "Uploading tests on OSX finished"
- name: Running Tests (Windows)
shell: powershell
if: runner.os == 'Windows' && 'KomodoPlatform/atomicDEX-Desktop' == github.repository
run: |
echo "Running tests"
$Env:REPORT_CI_TOKEN = "${{ secrets.REPORT_CI_TOKEN_SECRET }}"
$Env:QT_INSTALL_CMAKE_PATH = "C:\Qt\${{ matrix.qt }}\msvc2019_64"
cd b\bin
./${{ env.DEX_PROJECT_NAME }}_tests.exe --reporters=xml --out=${{ env.DEX_PROJECT_NAME }}-tests-result.xml -s
#Invoke-WebRequest -Uri https://report.ci/upload.py -OutFile upload.py
#python upload.py --sha $(git rev-parse HEAD) -n "[Doctest Windows]" --include='${{ env.DEX_PROJECT_NAME }}-tests-result.xml' --framework=doctest --merge ".*"
- name: Upload env variable for artifacts (Linux)
if: runner.os == 'Linux'
run: |
ls ./bundled/linux/
echo "artifact_name_zstd=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).tar.zst" >> $GITHUB_ENV
echo "artifact_name_zip=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "artifact_name_appimage=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD)-x86_64.AppImage" >> $GITHUB_ENV
echo "target_name_zstd=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD).tar.zst" >> $GITHUB_ENV
echo "target_name_zip=${{ env.DEX_PROJECT_NAME }}-linux-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV
echo "target_name_appimage=${{ env.DEX_PROJECT_NAME }}-$(git rev-parse --short HEAD)-x86_64.AppImage" >> $GITHUB_ENV
- name: Upload bundle artifact (Linux ZSTD)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_zstd }}
path: ./bundled/linux/${{ env.target_name_zstd }}
retention-days: 7
- name: Upload bundle artifact (Linux ZIP)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/linux/${{ env.target_name_zip }}
retention-days: 7
- name: Upload bundle artifact (Linux AppImage)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_appimage }}
path: ./bundled/linux/${{ env.target_name_appimage }}
retention-days: 7
- name: Upload env variable for artifacts (macOS)
if: runner.os == 'macOS'
run: |
ls ./bundled/osx/
echo "artifact_name_dmg=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).dmg" >> $GITHUB_ENV
echo "artifact_name_installer=${{ env.DEX_PROJECT_NAME }}-installer-${{ matrix.name }}-$(git rev-parse --short HEAD).7z" >> $GITHUB_ENV
- name: Upload artifacts (MacOS dmg)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_dmg }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}.dmg
retention-days: 7
- name: Upload artifacts (MacOS installer)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}_installer.7z
retention-days: 7
- name: Upload env variable for artifacts (Windows)
if: runner.os == 'Windows'
run: |
echo "on_windows"
echo "artifact_name_zip=${{ env.DEX_PROJECT_NAME }}-${{ matrix.name }}-$(git rev-parse --short HEAD).zip" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "artifact_name_installer=${{ env.DEX_PROJECT_NAME }}-installer-${{ matrix.name }}-$(git rev-parse --short HEAD).exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload artifacts (Windows zip)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/windows/bin.zip
retention-days: 7
- name: Upload artifacts (Windows installer)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}_installer.exe
retention-days: 7