-
-
Notifications
You must be signed in to change notification settings - Fork 655
214 lines (188 loc) · 7.23 KB
/
Copy pathtests.yml
File metadata and controls
214 lines (188 loc) · 7.23 KB
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
env:
TCL_VERSION: '8.6'
SQLITE_VERSION: '3530200'
PORTABLE_DIR: ${{ github.workspace }}/output/portable/Letos
name: Unit tests
on:
push:
branches:
- master
- 3.4
paths:
- '**.cpp'
- '**.hpp'
- '**.c'
- '**.h'
- '**.pro'
- '**.pri'
- '**.ui'
- '**.qrc'
- '**/tests.yml'
workflow_dispatch:
inputs:
debug_ssh:
description: "Open SSH tunnel at the end"
type: boolean
default: false
debug_on_failure:
description: "Open SSH tunnel if job fails"
type: boolean
default: false
target:
description: "Target Qt"
required: false
type: choice
options:
- "all"
- "6.2"
- "6.5"
- "6.8"
- "6.10"
default: "all"
jobs:
generate:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
- id: set
run: |
ALL='{
"6.2": {
"QT_VERSION": "6.2.4",
"PYTHON_VERSION": "3.9"
},
"6.5": {
"QT_VERSION": "6.5.3",
"PYTHON_VERSION": "3.9"
},
"6.8": {
"QT_VERSION": "6.8.3",
"PYTHON_VERSION": "3.12"
},
"6.10": {
"QT_VERSION": "6.11.1",
"PYTHON_VERSION": "3.12"
}
}'
matrix="$(echo $ALL | jq -r --arg v "${{ inputs.target }}" '.[$v]')"
if [ "$matrix" = "null" ]; then
matrix="$(echo $ALL | jq '[.[]]')"
fi
echo "Matrix:"
echo "$matrix"
{
echo "matrix<<EOF"
echo "$matrix"
echo "EOF"
} >> $GITHUB_OUTPUT
build:
needs: generate
runs-on: ubuntu-22.04
strategy:
matrix:
include: ${{ fromJson(needs.generate.outputs.matrix) }}
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PYTHON_VERSION }}
architecture: 'x64'
- name: Qt installation dir
id: qt-installation-dir
run: echo "DIR=$(readlink -f ${{ github.workspace }}/..)" >> $GITHUB_OUTPUT
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true
version: ${{ matrix.QT_VERSION }}
host: 'linux'
dir: '${{ steps.qt-installation-dir.DIR }}'
py7zrversion: '==0.20.*'
setup-python: 'false'
extra: '--external 7z'
- name: Clone GH scripts
uses: actions/checkout@v6
with:
repository: pawelsalawa/gh-action-scripts
ref: main
path: gh-scripts
- name: Setup GH scripts path
shell: bash
run: |
mv gh-scripts ..
cd ..
chmod +x gh-scripts/scripts/*.sh
echo "GH_SCRIPTS=$(pwd)/gh-scripts/scripts" >> $GITHUB_ENV
echo "DEBUG=${{ inputs.DEBUG }}" >> $GITHUB_ENV
- name: Clone repo
uses: actions/checkout@v6
with:
ref: ${{ env.GITHUB_REF }}
- name: Install SQLite3
run: |
cd ..
SQLITE_DOT_VERSION=$($GH_SCRIPTS/convert_int_ver.sh $SQLITE_VERSION)
SQLITE3_ZIP=sqlite3-linux-x64-$SQLITE_VERSION.zip
curl -L https://github.com/pawelsalawa/sqlite3-letos/releases/download/v$SQLITE_DOT_VERSION/$SQLITE3_ZIP --output $SQLITE3_ZIP
sudo rm -f /usr/lib/libsqlite* /usr/local/lib/libsqlite* /usr/include/sqlite* /usr/local/include/sqlite* /usr/lib/x86_64-linux-gnu/libsqlite*
sudo unzip $SQLITE3_ZIP libsqlite3.so -d /usr/local/lib
sudo unzip $SQLITE3_ZIP sqlite3.h sqlite3ext.h -d /usr/local/include
sudo ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.0
sudo ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.0.8.6
ls -l /usr/local/lib/libsqlite3*
ls -l /usr/local/include/sqlite*
- name: Install Tcl
run: sudo apt-get install -qq libtcl$TCL_VERSION tcl$TCL_VERSION-dev
- name: Install other tools/dependencies
run: |
sudo apt-get install libreadline-dev libncurses5-dev
echo "${{ github.workspace }}/../Qt/${{ matrix.QT_VERSION }}/gcc_64/bin" >> $GITHUB_PATH
- name: Prepare output dir
run: mkdir output output/build output/build-plugins
- name: Compile Letos
working-directory: output/build
run: |
cmake ../../Letos -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="${{ env.QT_ROOT_DIR }}" \
-DCMAKE_INSTALL_PREFIX=../Letos \
-DWITH_PORTABLE=1 \
-DWITH_UPDATER=1 \
-DBUILD_TESTING=1
cmake --build . --verbose
cmake --install . --verbose
- name: Compile Plugins
working-directory: output/build-plugins
run: |
cmake ../../Plugins -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="${{ env.QT_ROOT_DIR }}:${{ env.Python3_ROOT_DIR }}" \
-DCMAKE_INSTALL_PREFIX=../Letos \
-DWITH_PORTABLE=1 \
-DWITH_DYNAMIC_PYTHON=1 \
-DWITH_ALL_PLUGINS=1
cmake --build . --verbose
cmake --install . --verbose
- name: Run tests
working-directory: output/build
run: |
set -x
export LD_LIBRARY_PATH=./lib:${{ env.QT_ROOT_DIR }}/lib:/usr/local/lib
export LETOS_PLUGINS="${{ github.workspace }}/output/build-plugins/SqlEnterpriseFormatter"
ctest --verbose
- name: Install Midnight Commander
if: >
${{
github.repository_owner == 'pawelsalawa'
&& (inputs.debug_ssh || (failure() && inputs.debug_on_failure))
}}
run: sudo apt-get install mc
- name: Setup debugging SSH
if: >
${{
github.repository_owner == 'pawelsalawa'
&& (inputs.debug_ssh || (failure() && inputs.debug_on_failure))
}}
uses: owenthereal/action-upterm@v1
with:
wait-timeout-minutes: 10