-
Notifications
You must be signed in to change notification settings - Fork 26
249 lines (216 loc) · 8.56 KB
/
main.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
name: GHA CI
on:
push:
branches-ignore:
- 'dependabot**'
tags:
- '*'
paths-ignore:
- '**/lsan.supp'
- 'buildScripts/travis/*'
- 'buildScripts/azure/*'
- 'buildScripts/docker/*'
- 'azure-pipelines.yml'
- '.cirrus.yml'
- '.travis.yml'
- '.mergify.yml'
- 'Brewfile'
- '**/*.html'
- '**/*.txt'
- '**/*.md'
- 'installer/packages/**/meta/prebuild-mac.sh'
- 'installer/packages/**/meta/prebuild-linux-gnu.sh'
- '**/*.dockerfile'
- '**/*.Dockerfile'
- '**/Dockerfile'
- '**/Dockerfile.*'
- 'plugins/robots/checker/scripts/build-checker-installer.sh'
- '.github/workflows/centos.yml'
pull_request:
branches-ignore:
- 'dependabot**'
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.12'
mingw-version: 7.3
mingw-short-version: 73
python-version: 3.8
deploy-installer: true
# - qt-version: '5.15.2'
# mingw-version: 8.1
# mingw-short-version: 81
# python-version: 3.8
defaults:
run:
shell: msys2 {0}
steps:
- name: Cancel Previous Workflow Runs
uses: n1hility/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
path-type: inherit
msystem: MINGW32
- name: Download packages to msys2
run: |
ARCH=32
PLATFORM=i686
pacman --verbose --noconfirm -S msys/zlib-devel dos2unix ccache rsync unzip openssh mingw$ARCH/mingw-w64-$PLATFORM-libzip mingw$ARCH/mingw-w64-$PLATFORM-libusb mingw$ARCH/mingw-w64-$PLATFORM-zlib mingw$ARCH/mingw-w64-$PLATFORM-pkg-config
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Prepare build directory name
shell: bash
run: |
DIR=$(realpath $(cygpath -u "$GITHUB_WORKSPACE")/../build)
echo "BUILD_DIR=$DIR" >> $GITHUB_ENV
- name: Create build directory
run: mkdir -vp ${{ env.BUILD_DIR }}
- name: Configure git
shell: bash
run: |
git config --global core.symlinks true
git config --global core.autocrlf true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
dir: C:\
version: '${{matrix.qt-version}}.*'
arch: win32_mingw${{matrix.mingw-short-version}}
modules: 'qtscript'
archives: 'qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats qtwinextras'
tools: 'tools_mingw,qt.tools.win32_mingw${{matrix.mingw-short-version}}0'
extra: '--external 7z'
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Install proper version for QtIfw
run: |
cd "$RUNNER_TEMP"
curl -Lo qtifw.exe "https://download.qt.io/official_releases/qt-installer-framework/4.2.0/QtInstallerFramework-windows-x86-4.2.0.exe"
export TRIK_QT_INSTALL_DIR="${IQTA_TOOLS}/QtInstallerFramework/4.2.0"
mkdir -p $TRIK_QT_INSTALL_DIR
"$RUNNER_TEMP"/qtifw.exe --verbose --no-force-installations --show-virtual-components --script "${GITHUB_WORKSPACE}\\plugins\\robots\\thirdparty\\trikRuntime\\trikRuntime\\docker\\qt_scriptinstall.qs"
rm -rf "$TRIK_QT_INSTALL_DIR"/{doc,examples,Uninstaller.app,Uninstaller.dat}
# After Qt install action, that spoils pythonLocation variable
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}
architecture: 'x86'
- name: Update PATH
run: |
set -xue
cygpath -w "${IQTA_TOOLS}/mingw${{matrix.mingw-short-version}}0_32/bin" >> $GITHUB_PATH
cygpath -w "${pythonLocation}" >> $GITHUB_PATH
cygpath -w "${Qt5_Dir}/bin" >> $GITHUB_PATH
- name: Check PATH
run: echo PATH="$PATH"
- name: Check available tools
run: |
set -xueo pipefail
uname -a
rsync --version
ls "$IQTA_TOOLS/" "$Qt5_Dir/"
qmake --version && qmake -query
python3 --version
which g++
g++ --version
- name: QMake
timeout-minutes: 1
run: |
cd ${{ env.BUILD_DIR }}
qmake $GITHUB_WORKSPACE/studio.pro -spec win32-g++ CONFIG+=release CONFIG+=tests CONFIG+=noPch PYTHON_PATH="${pythonLocation}" # CONFIG+=silent
- name: QMake all
timeout-minutes: 5
run: |
cd ${{ env.BUILD_DIR }}
mingw32-make -j $(nproc) qmake_all
- name: Make all
timeout-minutes: 70
run: |
cd ${{ env.BUILD_DIR }}
mingw32-make -j $(nproc) all
- name: Unit tests
timeout-minutes: 5
run: |
cd ${{ env.BUILD_DIR }}
export TRIK_PYTHONPATH=$(cygpath -w "${pythonLocation}/Lib")
mingw32-make -k check
- name: Prepare all dlls
if: false
run: |
for file in $(ls ${{ env.BUILD_DIR }}/bin/release/*.exe || :) ; do windeployqt --release $file ; done
- name: Download tests
run: |
curl --output tests.7z "https://dl.trikset.com/edu/.solutions20200701/testing_small.7z"
7z x tests.7z
ls $GITHUB_WORKSPACE/testing_small
- name: Tests
id: tests
timeout-minutes: 2
continue-on-error: true
run: |
echo "$PATH"
echo ------
cd ${{ env.BUILD_DIR }}/bin/release
python "${{ github.workspace }}\buildScripts\tests\fieldstest.py" 2D-model.exe "${{ github.workspace }}\testing_small"
- name: Push binaries
if: false
uses: actions/upload-artifact@v2
with:
name: binaries-${{ matrix.qt-version}}
path: ${{ env.BUILD_DIR }}/bin/release
- name: Build installer
run: |
cd $GITHUB_WORKSPACE/installer
./build-trik-studio.sh "${Qt5_Dir}/bin" "${IQTA_TOOLS}/QtInstallerFramework/4.2.0/bin" "${{ env.BUILD_DIR }}"
- name: Push installer
uses: actions/upload-artifact@v2
with:
name: trik-studio-auto-installer-qt${{ matrix.qt-version}}
path: |
installer/trik-studio*installer*.exe
installer/trik_studio*.qs
installer/reinstall*
- name: Check errors
if: ${{ steps.tests.outcome == 'failure' }}
run: |
echo Errors occurred in the step Tests
exit 1
- name: Get tag
run: echo "CURRENT_TAG=$(git tag --contains HEAD | sort -Vr | head -n1)" >> $GITHUB_ENV
- name: Check tag
if: ${{ env.CURRENT_TAG != ''}}
run: echo "GITHUB_REF_SLUG=${{ env.CURRENT_TAG }}" >> $GITHUB_ENV
- name: Deploy installer
if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }}
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.DL_PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa
rsync -v --rsh="ssh -o StrictHostKeyChecking=no" installer/trik-studio*installer*.exe ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-i686-installer.exe
- name: Prepare for RDP connection
if: false #comment this line to create RDP session
continue-on-error: true
shell: pwsh
env:
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
run: |
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1
Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd!" -Force)
Invoke-WebRequest https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -OutFile ngrok.zip
Expand-Archive ngrok.zip
.\ngrok\ngrok.exe authtoken $Env:NGROK_AUTH_TOKEN
choco install far dependencies
.\ngrok\ngrok.exe tcp 3389