-
Notifications
You must be signed in to change notification settings - Fork 55
179 lines (162 loc) · 6.82 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
name: GHA CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
trik-version: ['', 'trik_new_age']
libs:
- qt-version: '5.12'
mingw-version: '7.3'
mingw-short-version: 73
python-version: '3.9'
- qt-version: '5.15'
mingw-version: '8.1'
mingw-short-version: 81
python-version: '3.12'
defaults:
run:
shell: pwsh #to prevent unexpected Git Bash with wrong MSys DLLs
steps:
- name: Configure git
shell: bash
run: |
git config --global core.symlinks true
git config --global core.autocrlf true
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1
- name: 'Disable Windows Just-in-Time Debugger/Error reporting'
shell: pwsh
run: |
# reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Debugger /d - /t REG_SZ /f
# reg add "HKLM\SOFTWARE\Microsoft\.NETFramework" /v DbgManagedDebugger /d - /t REG_SZ /f
# reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v DontShowUI /d 1 /t REG_DWORD /f
# reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v ForceQueue /d 1 /t REG_DWORD /f
# reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" /v DefaultConsent /d 1 /t REG_DWORD /f
# reg add "HKLM\System\CurrentControlSet\Control\Windows" /v ErrorMode /d 2 /t REG_DWORD /f
#
#
# reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Debugger /d - /t REG_SZ /f
# reg add "HKCU\SOFTWARE\Microsoft\.NETFramework" /v DbgManagedDebugger /d - /t REG_SZ /f
# reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v DontShowUI /d 1 /t REG_DWORD /f
# reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v ForceQueue /d 1 /t REG_DWORD /f
# reg add "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" /v DefaultConsent /d 1 /t REG_DWORD /f
#
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
release: true
update: false
msystem: MINGW32
path-type: inherit #strict #inherit #minimal
install: >-
base
rsync
git
- name: Purge MinGW conflicting packages
run: 'pacman --remove --noconfirm --cascade --recursive --unneeded gcc python3 || :'
shell: msys2 {0}
- name: Install Qt ${{ matrix.libs.qt-version }}
uses: jurplel/install-qt-action@v4
with:
version: ${{matrix.libs.qt-version}}
arch: win32_mingw${{matrix.libs.mingw-short-version}}
modules: 'qtscript'
archives: 'qtbase qtsvg qtserialport qtmultimedia qtwinextras qtimageformats i686 qttools qtdeclarative qtquickcontrols2'
tools: 'tools_mingw,qt.tools.win32_mingw${{matrix.libs.mingw-short-version}}0'
extra: '--external 7z'
# After Qt install action, that spoils pythonLocation variable
- name: Set up Python ${{ matrix.libs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.libs.python-version }}
architecture: 'x86'
- name: Update PATH
shell: msys2 {0}
run: |
set -xue
cygpath -w /usr/bin >> $GITHUB_PATH
cygpath -w /mingw32/bin >> $GITHUB_PATH
cygpath -w "${IQTA_TOOLS}/mingw${{matrix.libs.mingw-short-version}}0_32/bin" >> $GITHUB_PATH
cygpath -w "${pythonLocation}/bin" >> $GITHUB_PATH
cygpath -w "${QT_ROOT_DIR}/bin" >> $GITHUB_PATH
- name: Check PATH
shell: msys2 {0}
run: |
echo "Check for DLL-Hell"
where '$PATH:cygwin1.dll' '$PATH:libatomic-1.dll' '$PATH:libgcc_s_dw2-1.dll' '$PATH:libstdc++-6.dll' '$PATH:libwinpthread-1.dll' || :
echo '----'
echo "$GITHUB_PATH"
cat "$GITHUB_PATH"
echo '----'
echo PATH="$PATH"
- name: Check available tools
shell: msys2 {0}
run: |
set -xueo pipefail
uname -a
which rsync && rsync --version
which python3 && python3 --version
which g++ && g++ --version
ls "$IQTA_TOOLS/" "$QT_ROOT_DIR/"
which qmake && qmake --version
- name: QMake
shell: msys2 {0}
run: |
export PYTHON_VERSION=$(python3 --version | grep -o '3\.[^.]\+')
qmake trikRuntime.pro -spec win32-g++ CONFIG+=trik_not_brick CONFIG+=tests CONFIG+=release \
PYTHON_PATH="${pythonLocation}" PYTHON_VERSION=${PYTHON_VERSION} \
CONFIG+=force_debug_info CONFIG+="${{ matrix.trik-version }}"
- name: QMake all
shell: msys2 {0}
timeout-minutes: 5
run: mingw32-make -j $(nproc) qmake_all
- name: Make all
shell: msys2 {0}
timeout-minutes: 10
run: mingw32-make -j $(nproc) all
- name: Tests
id: tests
shell: msys2 {0}
timeout-minutes: 3
continue-on-error: true
run: |
echo "$PATH"
echo ------
export TRIK_PYTHONPATH=$(cygpath -w "$pythonLocation/Lib")
export PYTHONDEVMODE=1
mingw32-make check -k
- name: Prepare for RDP connection
if: false
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
- name: Check errors
if: ${{ steps.tests.outcome == 'failure' }}
run: |
echo Errors occurred in the step Tests
exit 1