-
Notifications
You must be signed in to change notification settings - Fork 26
210 lines (180 loc) · 7.13 KB
/
centos.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
name: Check with CentOS 7
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-win32.sh'
- '**/*.dockerfile'
- '**/*.Dockerfile'
- '**/Dockerfile'
- '**/Dockerfile.*'
- 'plugins/robots/checker/scripts/build-checker-installer.sh'
- '.github/workflows/main.yml'
pull_request:
branches-ignore:
- 'dependabot**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: centos:7
defaults:
run:
shell: bash -l {0} # to force import of ~/.bash_profile
strategy:
fail-fast: false
matrix:
include:
- qt-version: '5.12'
python-minor: 8
gcc-version: 11
deploy-installer: true
steps:
- name: Cancel Previous Workflow Runs
uses: n1hility/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install CentOS packages
run: |
yum install -y epel-release centos-release-scl
yum install -y libusbx-devel curl wget devtoolset-${{ matrix.gcc-version }}-{gcc-c++,make,libasan-devel,libubsan-devel} \
rh-git227-git-core ccache zlib-devel rsync rh-python3${{ matrix.python-minor }}-python-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip which
yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw
yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform
echo "source scl_source enable devtoolset-${{ matrix.gcc-version }} rh-python3${{ matrix.python-minor }} rh-git227" >> ~/.bash_profile
- name: Prepare environment variables
run: |
DIR=$(realpath "$GITHUB_WORKSPACE"/../build)
echo "BUILD_DIR=$DIR" >> $GITHUB_ENV
echo "LC_ALL=en_US.utf8" >> $GITHUB_ENV
- name: Configure git
run: |
git --version
git config --global core.symlinks true
git config --global core.autocrlf false
#prepare for actions/checkout, otherwise it fails
echo "$(dirname $(realpath $(which git)))" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PERL5LIB=$PERL5LIB" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: recursive
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Create build directory
run: mkdir -vp ${{ env.BUILD_DIR }}
- name: Install Qt
run: |
set -ueo pipefail
python3 -m pip install -U pip
python3 -m pip install aqtinstall
aqt install-qt linux desktop "${{ matrix.qt-version }}.*" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland
# aqt install-tool linux desktop tools_ifw -O /Qt
echo "Qt5_Dir=$(ls -1d /Qt/5*/* | head -n 1)" >> $GITHUB_ENV
echo "IQTA_TOOLS=/Qt/Tools" >> $GITHUB_ENV
- name: Install proper version for QtIfw
if: false
run: |
- name: Update PATH
run: |
set -xue
echo "${Qt5_Dir}/bin" >> $GITHUB_PATH
- name: Check PATH
run: echo PATH="$PATH"
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Check available tools
run: |
set -xueo pipefail
uname -a
rsync --version
# ls "$IQTA_TOOLS/"
ls "$Qt5_Dir/"
qmake --version && qmake -query
python3 --version
which g++
g++ --version
ccache --version
- name: QMake
timeout-minutes: 1
run: |
cd ${{ env.BUILD_DIR }}
qmake $GITHUB_WORKSPACE/studio.pro CONFIG+=release CONFIG+=tests PYTHON3_VERSION_MINOR=${{ matrix.python-minor }} CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined
- name: QMake all
timeout-minutes: 5
run: |
cd ${{ env.BUILD_DIR }}
make -j $(nproc) qmake_all
- name: Make all
timeout-minutes: 70
run: |
cd ${{ env.BUILD_DIR }}
make -j $(nproc) all
- name: Unit tests
timeout-minutes: 5
run: |
cd ${{ env.BUILD_DIR }}
export TRIK_PYTHONPATH=$(python3 -c "import sys; import os; print(os.pathsep.join(sys.path))")
make -k check TESTARGS="-platform offscreen"
- name: Download tests
run: |
curl --output tests.7z "https://dl.trikset.com/edu/.solutions20200701/testing_small.7z"
7za 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
env QT_QPA_PLATFORM=minimal python3 "${GITHUB_WORKSPACE}/buildScripts/tests/fieldstest.py" ./2D-model "${GITHUB_WORKSPACE}/testing_small"
- name: Build installer
run: |
set -vx
cd "$GITHUB_WORKSPACE"/installer
export TRIK_PYTHON3_VERSION_MINOR=${{ matrix.python-minor }}
# bash -xv ./build-trik-studio.sh "${Qt5_Dir}/bin" $(ls -1d "${IQTA_TOOLS}"/QtInstallerFramework/*/bin | head -n 1) "${{ env.BUILD_DIR }}"
- name: Push installer
if: false
uses: actions/upload-artifact@v2
with:
name: trik-studio-auto-installer-linux-qt${{ matrix.qt-version }}
path: |
installer/trik-studio*installer*.run
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: ${{ false && 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*.run ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-linux-generic-installer.run