Skip to content

Commit 85e1739

Browse files
authored
Merge branch 'master' into fix/taskbar_icon
2 parents 4cac9a0 + 7ff9657 commit 85e1739

File tree

226 files changed

+3337
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+3337
-1531
lines changed

.github/workflows/codacy-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
steps:
2222
# Checkout the repository to the GitHub Actions runner
2323
- name: Checkout code
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
2525
with:
2626
submodules: true
2727

2828
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
2929
- name: Run Codacy Analysis CLI
30-
uses: codacy/codacy-analysis-cli-action@v4.4.5
30+
uses: codacy/codacy-analysis-cli-action@v4.4.7
3131
with:
3232
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
3333
# You can also omit the token and run the tools that support default configurations

.github/workflows/common_build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: ./.github/workflows/setup_environment.yml
4141
with:
4242
os: ubuntu-latest
43-
lint: true
43+
lint_vera: true
4444
build: false
4545
build_installer: false
4646

@@ -93,6 +93,7 @@ jobs:
9393
build_installer: false
9494
qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=use_system_qscintilla2 CONFIG+=use_system_quazip"
9595
trik_python3_version_minor: 10
96+
lint_clazy: true
9697

9798
build-ubuntu-debug-tests:
9899
needs: lint
@@ -113,6 +114,7 @@ jobs:
113114
container_name: alt:latest
114115
build: true
115116
build_installer: false
117+
trik_python3_version_minor: 12
116118
qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers"
117119
tests: true
118120

@@ -139,7 +141,8 @@ jobs:
139141
os: ubuntu-latest
140142
container_name: rockylinux:8
141143
build: true
142-
build_installer: false
144+
build_installer: true
145+
need_deploy: false
143146
qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined CONFIG+=sanitize_address"
144147
gcc_version: 13
145148
trik_qt_version: 5.15
@@ -192,7 +195,7 @@ jobs:
192195
uses: ./.github/workflows/installer.yml
193196
with:
194197
os: ubuntu-latest
195-
container_name: registry.astralinux.ru/library/astra/ubi18:latest
198+
container_name: registry.astralinux.ru/library/astra/ubi18-python311:1.8.1
196199
artifact_name: linux-installer
197200

198201
install-archlinux-installer:

.github/workflows/installer.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Install dependencies
4949
run: |
50-
apt-get update && apt-get install -y --no-install-recommends git-core p7zip-full curl sudo
50+
apt-get update && apt-get install -y --no-install-recommends git-core p7zip-full curl sudo locales
5151
sed -i 's/^# \(WHEEL_USERS.*\)/\1/' /etc/sudoers
5252
if: contains(inputs.container_name, 'astra')
5353

@@ -66,15 +66,18 @@ jobs:
6666
- name: Install dependencies
6767
run: HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install p7zip || brew upgrade p7zip
6868
if: startsWith(inputs.os, 'mac')
69-
69+
7070
- name: Checkout repository
71-
uses: actions/checkout@v4
71+
uses: actions/checkout@v5
7272
with:
7373
submodules: recursive
7474
fetch-depth: 1
7575

76+
- name: Set locale
77+
run: echo "LANG=C.UTF-8" >> $GITHUB_ENV
78+
7679
- name: Download installer artifact
77-
uses: actions/download-artifact@v4
80+
uses: actions/download-artifact@v5
7881
with:
7982
name: ${{ inputs.artifact_name }}
8083

@@ -137,7 +140,7 @@ jobs:
137140
- name: Run minimal Python interpeter tests in direct script mode
138141
run: |
139142
PATH="" $SHELL -c 'for i in "$GITHUB_WORKSPACE"/tests/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".py \
140-
--close -s 5 --script-path "$i".py -m script "$i"; done'
143+
--generate-mode python --close -s 5 --script-path "$i".py -m script "$i"; done'
141144
timeout-minutes: 15
142145

143146
- name: Run minimal Javascript interpeter tests as fields in .qrs (For backward compatibility)
@@ -151,3 +154,16 @@ jobs:
151154
PATH="" $SHELL -c 'for i in "$GITHUB_WORKSPACE"/tests/*.qrs; do "$PATCHER_NAME" -s "$i".py "$i" \
152155
&& "$TWOD_EXEC_NAME" --close -s 5 -m script "$i"; done'
153156
timeout-minutes: 5
157+
158+
- name: Run nxt generation tests
159+
run: |
160+
curl --output nxt_tests.7z "https://dl.trikset.com/edu/.solutions20200701/nxt_generation.7z"
161+
7z x nxt_tests.7z || 7za x nxt_tests.7z
162+
set -x
163+
for i in "$GITHUB_WORKSPACE"/nxt/*.qrs;
164+
do
165+
"$TWOD_EXEC_NAME" --generate-mode nxt --generate-path "$i".c --only-generate "$i"
166+
ls "$GITHUB_WORKSPACE"/nxt/
167+
cat "$i".c
168+
done
169+
timeout-minutes: 5

.github/workflows/setup_environment.yml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ on:
1010
required: false
1111
type: string
1212
default: "time"
13-
lint:
13+
lint_vera:
1414
required: false
1515
type: boolean
1616
default: false
17+
lint_clazy:
18+
required: false
19+
type: boolean
20+
default: false
21+
need_deploy:
22+
required: false
23+
type: boolean
24+
default: true
1725
build:
1826
required: true
1927
type: boolean
@@ -90,12 +98,13 @@ jobs:
9098
run: |
9199
git config --global core.symlinks true
92100
git config --global core.autocrlf input
101+
echo "BUILD_DIR=${{ github.workspace }}/build" >> $GITHUB_ENV
93102
94103
- name: Checkout repository
95-
uses: actions/checkout@v4
104+
uses: actions/checkout@v5
96105
with:
97106
submodules: recursive
98-
fetch-depth: 0
107+
fetch-depth: 2
99108

100109
- name: Remove thirdparty submodules (use from libs from distro)
101110
run: |
@@ -120,11 +129,11 @@ jobs:
120129
INSTALL_INSTALLER_ENVIRONMENT: ${{ inputs.linux_installer_environment }}
121130
if: ${{ inputs.build }}
122131

123-
- name: Lint
132+
- name: Lint Vera
124133
run: |
125134
sudo apt-get update && sudo apt-get install -y --no-install-recommends qttools5-dev-tools qtbase5-dev vera++
126135
${{ inputs.executor }} buildScripts/github/vera_translation.sh
127-
if: ${{ inputs.lint }}
136+
if: ${{ inputs.lint_vera }}
128137

129138
- name: Restore cache
130139
uses: actions/cache@v4
@@ -138,7 +147,7 @@ jobs:
138147
if: ${{ inputs.build }}
139148

140149
- name: Build
141-
run: buildScripts/github/build.sh
150+
run: "$GITHUB_WORKSPACE/buildScripts/github/build.sh"
142151
env:
143152
TRIK_QT_VERSION: ${{ inputs.trik_qt_version }}
144153
TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }}
@@ -148,6 +157,9 @@ jobs:
148157
CONFIG: ${{ inputs.config }}
149158
EXECUTOR: ${{ inputs.executor }}
150159
QMAKE_EXTRA: ${{ inputs.qmake_extra }}
160+
NEED_COMPILE_DATABASE: ${{ inputs.lint_clazy }}
161+
BUILD_DIR: ${{ env.BUILD_DIR }}
162+
ROOT_DIR: ${{ github.workspace }}
151163
if: ${{ inputs.build }}
152164

153165
- name: Save build cache
@@ -158,15 +170,31 @@ jobs:
158170
if: ${{ inputs.build }}
159171

160172
- name: Run tests
161-
run: ${{ inputs.executor }} buildScripts/github/run_tests.sh
173+
run: ${{ inputs.executor }} "$GITHUB_WORKSPACE/buildScripts/github/run_tests.sh"
174+
working-directory: ${{ env.BUILD_DIR }}
162175
env:
163176
TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }}
164177
TESTS: ${{ inputs.tests }}
165178
if: ${{ inputs.build == true }}
166179

180+
- name: Clazy-standalone
181+
uses: MinyazevR/clazy-standalone-action@v0.3.3
182+
with:
183+
checks: 'level0,level1,level2,no-qstring-allocations,no-ctor-missing-parent-argument,no-qproperty-without-notify,no-detaching-member'
184+
database: 'build'
185+
fail-on-warning: true
186+
install-stable: true
187+
only-diff: true
188+
ignore-dirs: '^(buildScripts|thirdparty|installer)$'
189+
root-dir: ${{ github.workspace }}
190+
ignore-header-deps: true
191+
ignore-external-files: true
192+
if: ${{ inputs.lint_clazy }}
193+
167194
- name: Build Installer
168195
run: |
169-
buildScripts/github/build_installer.sh
196+
"$GITHUB_WORKSPACE/buildScripts/github/build_installer.sh"
197+
working-directory: ${{ env.BUILD_DIR }}
170198
env:
171199
TRIK_QT_VERSION: ${{ inputs.trik_qt_version }}
172200
TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }}
@@ -175,16 +203,20 @@ jobs:
175203
EXECUTOR: ${{ inputs.executor }}
176204
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
177205
PULLREQUESTNUMBER: ${{ github.event.pull_request.number }}
206+
NEED_DEPLOY: ${{ inputs.need_deploy }}
178207
ssh_key: ${{ secrets.DL_PRIVATE_SSH_KEY }}
179208
username: ${{ secrets.DL_USERNAME }}
180209
host: ${{ secrets.DL_HOST }}
210+
ROOT_DIR: ${{ github.workspace }}
181211
if: ${{ inputs.build_installer }}
182212

183213
- name: Evaluate artifact name
184214
run: |
185215
set -x
186-
echo "ARTIFACT_INSTALLER_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')-installer" >> $GITHUB_ENV
187-
env
216+
ldd "./bin/trik-studio" | grep -q libasan && SUFFIX="-asan" || SUFFIX=
217+
echo "ARTIFACT_INSTALLER_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')-installer${SUFFIX}" >> $GITHUB_ENV
218+
working-directory: ${{ env.BUILD_DIR }}
219+
if: ${{ inputs.build_installer }}
188220

189221
- name: Upload installer artifact
190222
uses: actions/upload-artifact@v4

.github/workflows/windows_build_with_installer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
extra: '--external 7z'
104104

105105
- name: Checkout repository
106-
uses: actions/checkout@v4
106+
uses: actions/checkout@v5
107107
with:
108108
submodules: recursive
109109
fetch-depth: 0

.gitmodules

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
[submodule "plugins/robots/thirdparty/trikRuntime"]
22
path = plugins/robots/thirdparty/trikRuntime/trikRuntime
33
url = https://github.com/trikset/trikRuntime
4+
branch = master
45
[submodule "qrtest/thirdparty/googletest/googletest"]
56
path = qrtest/thirdparty/googletest/googletest
67
url = https://github.com/google/googletest
8+
branch = main
79
[submodule "qrgui/thirdparty/qt-solutions"]
810
path = qrgui/thirdparty/qt-solutions
911
url = https://github.com/trikset/qt-solutions
12+
branch = master
1013
[submodule "thirdparty/gamepad/gamepad"]
1114
path = thirdparty/gamepad/gamepad
1215
url = https://github.com/trikset/trik-desktop-gamepad
16+
branch = master
1317
[submodule "plugins/robots/thirdparty/hidapi"]
1418
path = plugins/robots/thirdparty/hidapi
1519
url = https://github.com/libusb/hidapi
1620
[submodule "thirdparty/quazip/quazip"]
1721
path = thirdparty/quazip/quazip
1822
url = https://github.com/stachenov/quazip.git
23+
branch = master
1924
[submodule "plugins/robots/thirdparty/Box2D/Box2D"]
2025
path = plugins/robots/thirdparty/Box2D/Box2D
21-
url = https://github.com/iakov/Box2D
26+
url = https://github.com/erincatto/box2d
2227
branch = "trik-studio"
2328
[submodule "thirdparty/qslog/qslog"]
2429
path = thirdparty/qslog/qslog
25-
url = https://bitbucket.org/codeimproved/qslog.git
30+
url = https://github.com/trikset/trik-qslog.git
31+
branch = codeimproved-master
2632
[submodule "installer/nxt-tools"]
2733
path = installer/nxt-tools
2834
url = https://github.com/trikset/nxt-tools.git
29-
branch = main
35+
branch = master
3036
[submodule "trik-checkapp"]
3137
path = thirdparty/checkapp/checkapp
3238
url = https://github.com/trikset/trik-checkapp
33-
[submodule "plugins/robots/thirdparty/qextserialport/qextserialport"]
34-
path = plugins/robots/thirdparty/qextserialport/qextserialport
35-
url = https://github.com/qextserialport/qextserialport
39+
branch = master

NOTICE

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ This software may use following third-party components:
55
* QtPropertyBrowser by Digia Plc, licensed under BSD License. Copy of this license can be found in installer/licenses/QtPropertyBrowser-license.txt.
66
* QsKineticScroller by Razvan Petru, licensed under BSD License. Copy of this license can be found in installer/licenses/QsKineticScroller-license.txt.
77
* WindowsModernStyle by Michał Męciński, licensed under BSD License. Copy of this license can be found in installer/licenses/WindowsModernStyle-license.txt.
8-
* QextSerialPort, by Wayne Roth, Stefan Sander, Michal Policht, Brandon Fosdick, Liam Staskawicz, Debao Zhang.
9-
It is licensed under MIT License. Copy of this license can be found in installer/licenses/QextSerialPort-license.txt.
108

119
It also uses Pfennig font by Daniel Johnson, licensed under SIL Open Font License (OFL). Copy of this license can be found in installer/licenses/OFL.txt.
1210

@@ -15,4 +13,4 @@ Some icons are provided by Tatiana Yanchuk and are available under Creative Comm
1513
We are very grateful to the authors of components and resources above for allowing us to use their work in our product.
1614

1715
Considering license information, our product is licensed under Apache License v2.0 (installer/licenses/ApacheLicense-v2.0.txt).
18-
Its source code is available at our GitHub repository: https://github.com/qreal/qreal
16+
Its source code is available at our GitHub repository: https://github.com/qreal/qreal

buildScripts/github/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ CCACHE_DIR="$CCACHE_DIR" \
3838
CONFIG="$CONFIG" \
3939
QMAKE_EXTRA="$QMAKE_EXTRA" \
4040
PROJECT="$PROJECT" \
41+
BUILD_DIR="$BUILD_DIR" \
42+
ROOT_DIR="$ROOT_DIR" \
4143
RUNNER_OS="$RUNNER_OS" \
4244
buildScripts/github/build_internal.sh
4345

buildScripts/github/build_installer.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ case "$RUNNER_OS" in
1717
esac
1818
df -h .
1919

20-
NEED_DEPLOY=$([[ "$GITHUB_REPOSITORY" == "trikset/trik-studio" && "${PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false )
20+
IS_ORIGIN_MASTER=$([[ "$GITHUB_REPOSITORY" == "trikset/trik-studio" && "${PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false )
21+
NEED_DEPLOY=$([[ "$IS_ORIGIN_MASTER" == "true" && "$NEED_DEPLOY" == "true" ]] && echo true || echo false )
2122

2223
if "$NEED_DEPLOY" ; then
2324
$EXECUTOR bash -c "mkdir -p $HOME/.ssh && install -m 600 /dev/null $HOME/.ssh/id_rsa && echo \"$ssh_key\" > $HOME/.ssh/id_rsa"
@@ -32,10 +33,14 @@ if [[ "$RUNNER_OS" == Linux ]] ; then
3233
fi
3334

3435
echo Start build installer
35-
$EXECUTOR bash -c "installer/build-trik-studio.sh $QTBIN $QTIFWBIN ."
36+
$EXECUTOR bash -c "$ROOT_DIR/installer/build-trik-studio.sh $QTBIN $QTIFWBIN ."
37+
38+
pushd "$ROOT_DIR"
3639

3740
INSTALLER_NAME=$(find installer -name "trik-studio*installer*" -print -quit | grep . )
3841

3942
if "$NEED_DEPLOY" ; then
4043
$EXECUTOR bash -c "rsync -v --rsh='ssh -o StrictHostKeyChecking=no -vvv -i $HOME/.ssh/id_rsa' $INSTALLER_NAME $username@$host:~/dl/ts/fresh/installer/$TSNAME"
4144
fi
45+
46+
popd

buildScripts/github/build_internal.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ qmake -query
1010
ccache -sz
1111
{ which python3 && python3 -V || true ; }
1212
{ which python && python -V || true ; }
13+
mkdir -p build && pushd "$BUILD_DIR"
1314
export PYTHON_DIR=$(python3.${TRIK_PYTHON3_VERSION_MINOR}-config --prefix)
1415
rm -f .qmake.cache
15-
qmake -Wall PYTHON_VERSION=3.$TRIK_PYTHON3_VERSION_MINOR PYTHON_PATH=/usr CONFIG+=$CONFIG $QMAKE_EXTRA $PROJECT.pro
16+
17+
qmake -Wall PYTHON_VERSION=3.$TRIK_PYTHON3_VERSION_MINOR PYTHON_PATH=/usr CONFIG+=$CONFIG $QMAKE_EXTRA "$ROOT_DIR/$PROJECT.pro"
1618
make -j $(nproc) qmake_all 2>&1 | tee -a build.log
1719
ccache -s
18-
make -j $(nproc) all 2>&1 | tee -a build.log
20+
if [ "$NEED_COMPILE_DATABASE" = "true" ]; then
21+
bear -- make -j $(nproc) all 2>&1 | tee -a build.log
22+
else
23+
make -j $(nproc) all 2>&1 | tee -a build.log
24+
fi
1925
ccache -s
2026
ls bin

0 commit comments

Comments
 (0)