From ae4ebaf1551c1568ab5b58a67ddcb559e0fe8b64 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 09:04:15 +0300 Subject: [PATCH 01/19] Add macOS-12 CI --- buildScripts/github/build.sh | 41 ++++++++++++++++++++++++ buildScripts/github/build_installer.sh | 36 +++++++++++++++++++++ buildScripts/github/build_internal.sh | 41 ++++++++++++++++++++++++ buildScripts/github/checkStatus.sh | 11 +++++++ buildScripts/github/install_Linux.sh | 5 +++ buildScripts/github/install_macOS.sh | 20 ++++++++++++ buildScripts/github/install_qtifw_mac.sh | 16 +++++++++ buildScripts/github/runVera++.sh | 26 +++++++++++++++ buildScripts/github/test.sh | 12 +++++++ buildScripts/github/vera_translation.sh | 9 ++++++ 10 files changed, 217 insertions(+) create mode 100755 buildScripts/github/build.sh create mode 100755 buildScripts/github/build_installer.sh create mode 100755 buildScripts/github/build_internal.sh create mode 100755 buildScripts/github/checkStatus.sh create mode 100755 buildScripts/github/install_Linux.sh create mode 100755 buildScripts/github/install_macOS.sh create mode 100755 buildScripts/github/install_qtifw_mac.sh create mode 100755 buildScripts/github/runVera++.sh create mode 100755 buildScripts/github/test.sh create mode 100755 buildScripts/github/vera_translation.sh diff --git a/buildScripts/github/build.sh b/buildScripts/github/build.sh new file mode 100755 index 0000000000..55d812c520 --- /dev/null +++ b/buildScripts/github/build.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -uxeo pipefail + +CODECOV=true +case $RUNNER_OS in + macOS) + QT_DIR=$(ls -dv "$HOME"/Qt/${TRIK_QT_VERSION}*/*/bin | head -n 1) + [ -d "$QT_DIR" ] && export PATH="$QT_DIR:$PATH" + export PATH="/usr/local/opt/ccache/libexec:$PATH" + export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + echo "Now path is $PATH" + ;; + Linux) + ;; + *) exit 1 ;; +esac + +mkdir -p $CCACHE_DIR || sudo chown -R $USER $CCACHE_DIR || : +cat << EOF > $CCACHE_CONFIGPATH +compiler_check=content +run_second_cpp=true +cache_dir=$CCACHE_DIR +compression=true +compression_level=1 +sloppiness=time_macros,pch_defines,include_file_ctime,include_file_mtime,file_stat_matches +max_size=1200M +EOF + +$EXECUTOR env \ +CCACHE_CONFIGPATH="$CCACHE_CONFIGPATH" \ +CONFIG="$CONFIG" \ +QMAKE_EXTRA="$QMAKE_EXTRA" \ +PROJECT="$PROJECT" \ +RUNNER_OS="$RUNNER_OS" \ +TESTS="$TESTS" \ +buildScripts/github/build_internal.sh + + +df -h . + +$CODECOV diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh new file mode 100755 index 0000000000..2668cc6f5d --- /dev/null +++ b/buildScripts/github/build_installer.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -euxo pipefail +BRANCH_NAME="${BRANCH_NAME:-${GITHUB_REF#refs/heads/}}" +QTBIN=${QTBIN:-$($EXECUTOR bash -c 'eval $(make qmake -n | cut -f 1 -d " ") -query QT_INSTALL_BINS')} +case $RUNNER_OS in + Darwin) + QTIFWBIN=$HOME/qtifw/bin + TSNAME=trik-studio-installer-mac-$BRANCH_NAME.dmg +# export TRIK_PYTHON3_VERSION_MINOR="$(python3 -V | sed 's#^Python 3\.\([0-9]+\)\.[0-9]+$#\1#g')" + ;; + Linux) + QTIFWBIN=/opt/qtifw/bin + #QTIFWBIN=$($EXECUTOR bash -c 'find /Qt/Tools/QtInstallerFramework/ -maxdepth 2 -name bin -type d -print0 | sort -Vrz | head -zn 1') + TSNAME=trik-studio-installer-linux-$BRANCH_NAME.run + ;; + *) exit 1 ;; +esac +df -h . + +NEED_DEPLOY=$([[ "$GITHUB_REPOSITORY" == "trikset/trik-studio" && "${PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false ) + +if [[ $AGENT_OS == Linux ]] ; then + echo Start build checker archive + $EXECUTOR bash -ic "bin/$CONFIG/build-checker-installer.sh" + if $NEED_DEPLOY ; then + $EXECUTOR bash -ic "sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' bin/$CONFIG/trik_checker.tar.xz $server:dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME.tar.xz" + fi +fi +echo Start build installer +$EXECUTOR bash -ic "installer/build-trik-studio.sh $QTBIN $QTIFWBIN ." + +if $NEED_DEPLOY ; then + $EXECUTOR bash -ic "\ + mv installer/trik-studio*installer* installer/$TSNAME \ + && sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' installer/$TSNAME $server:dl/ts/fresh/installer/" +fi diff --git a/buildScripts/github/build_internal.sh b/buildScripts/github/build_internal.sh new file mode 100755 index 0000000000..619816870e --- /dev/null +++ b/buildScripts/github/build_internal.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +#This is a magic fix for macOS, but old Linux /usr/bin/env has no -S option, thus we cannot use shabang line +#An obsolete bash (v3) does not support `exec {varname}<>`, thus we want to use zsh +if ! ( eval 'exec {somevar}<>$(mktemp)' ) ; then + COMPATIBLE_SHELL=/bin/zsh + [ ! -x $COMPATIBLE_SHELL ] && COMPATIBLE_SHELL=/bin/bash || : + exec $COMPATIBLE_SHELL "$0" "$@" +fi + +# enable kinda `bash compatibility` in zsh +if [ -n "$ZSH_VERSION" ] ; then setopt SH_WORD_SPLIT ; fi + +set -xueo pipefail +exec {lock}<>$(mktemp -t trik-build-lock.XXXX) && trap 'while [ -e /proc/$$/fd/$lock ] && [ $(lsof -t /proc/$$/fd/$lock | wc -l) -ne 3 ] ; do echo "Sleep to wait ..." ; lsof /proc/$$/fd/$lock ; sleep 5 ; done' EXIT +export LANG=C +ccache -V && ccache -p +which g++ +g++ --version +which qmake +qmake -query +ccache -sz +{ which python3 && python3 -V || true ; } +{ which python && python -V || true ; } +export PKG_CONFIG_PATH=$(python3.${TRIK_PYTHON3_VERSION_MINOR}-config --prefix)/lib/pkgconfig +rm -f .qmake.cache +{ echo -n 'Remove broken object files ' ; find . -name '*.o' -type f -print0 | xargs -0 file --mime-type | grep -v 'application/x-object' | cut -f 1 -d ':' | xargs -t rm -f _RM_REQUIRES_ARGUMENTS_BUT_BSD_XARGS_IS_MISSING_R_PARAMETER_ARGUMENT || : ; echo Done ; } +qmake -Wall PYTHON3_VERSION_MINOR=$TRIK_PYTHON3_VERSION_MINOR CONFIG+=$CONFIG $QMAKE_EXTRA $PROJECT.pro +make -j $(nproc) qmake_all 2>&1 | tee -a build.log +ccache -s +make -j $(nproc) all 2>&1 | tee -a build.log +ccache -s +ls bin/$CONFIG +export QT_QPA_PLATFORM=minimal +export ASAN_OPTIONS=$(if [[ $AGENT_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0 +export LSAN_OPTIONS=suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0 +export DISPLAY=:0 +export TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} +export PYTHONMALLOC=malloc +env +make check -k -s && ( set +eux ; cd "bin/$CONFIG" && eval "$TESTS" ) diff --git a/buildScripts/github/checkStatus.sh b/buildScripts/github/checkStatus.sh new file mode 100755 index 0000000000..22c67a625e --- /dev/null +++ b/buildScripts/github/checkStatus.sh @@ -0,0 +1,11 @@ +#!/bin/bash +gitStatus=$(git status -s && git submodule --quiet foreach --recursive git status -s) +if [ ! -z "$gitStatus" ] +then + echo $gitStatus + echo git status must be clean + git diff --minimal + false +else + true +fi diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh new file mode 100755 index 0000000000..ede6570e75 --- /dev/null +++ b/buildScripts/github/install_Linux.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -euxo pipefail +docker pull trikset/linux-builder +docker run --cap-add SYS_PTRACE -d -v $HOME:$HOME:rw -w `pwd` --name builder trikset/linux-builder Xvfb :0 +docker exec builder git config --global --add safe.directory '*' diff --git a/buildScripts/github/install_macOS.sh b/buildScripts/github/install_macOS.sh new file mode 100755 index 0000000000..e855972e58 --- /dev/null +++ b/buildScripts/github/install_macOS.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -euo pipefail +export HOMEBREW_NO_INSTALL_CLEANUP=1 +export HOMEBREW_NO_AUTO_UPDATE=1 +brew tap "hudochenkov/sshpass" +TRIK_BREW_PACKAGES="ccache coreutils libusb pkg-config gnu-sed sshpass p7zip python@3.${TRIK_PYTHON3_VERSION_MINOR}" +for pkg in $TRIK_BREW_PACKAGES ; do + p="${pkg##*/}" + p="${p%.*}" + brew install "$pkg" || brew upgrade "$pkg" || brew link --force "$pkg" || echo "Failed to install/upgrade $pkg" +done +TRIK_PYTHON=python3.${TRIK_PYTHON3_VERSION_MINOR} +"$TRIK_PYTHON" -m pip install -U pip +"$TRIK_PYTHON" -m pip install aqtinstall +"$TRIK_PYTHON" -m aqt install-qt -m qtscript -O "$HOME/Qt" mac desktop "${TRIK_QT_VERSION}" +[ -d $HOME/qtifw ] || env TRIK_QT_INSTALL_DIR="$HOME/qtifw" "$(dirname $(realpath ${BASH_SOURCE[0]}))"/install_qtifw_mac.sh + +sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer +xcodebuild -showsdks +xcrun -sdk macosx --show-sdk-path diff --git a/buildScripts/github/install_qtifw_mac.sh b/buildScripts/github/install_qtifw_mac.sh new file mode 100755 index 0000000000..44ea1bde64 --- /dev/null +++ b/buildScripts/github/install_qtifw_mac.sh @@ -0,0 +1,16 @@ +#!/bin/bash -x +TRIK_QT_INSTALL_DIR=${TRIK_QT_INSTALL_DIR:-$HOME/TRIK_QtIfw} +SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) +set -ueo pipefail +#The latest with Qt 5.12 as minimal required, 4.3.0 requires Qt 5.15 +QTIFW_VERSION=${QTIFW_VERSION:-4.6.1} +D=/tmp/qtifw-installer.dmg +test -r "$D" || curl -L -o "$D" "http://download.qt-project.org/official_releases/qt-installer-framework/$QTIFW_VERSION/QtInstallerFramework-macOS-x64-${QTIFW_VERSION}.dmg" +P=$(hdiutil attach "$D" -noverify -noautofsck | grep -o '/Volumes/.*$') +I=$(find "$P" -type f -perm +1 -path '*Contents/MacOS/*' -print | head -n 1 ) +env TRIK_QT_INSTALL_DIR="$TRIK_QT_INSTALL_DIR" "$I" --verbose --no-force-installations --show-virtual-components --script "$SCRIPT_DIR/../../plugins/robots/thirdparty/trikRuntime/trikRuntime/docker/qt_scriptinstall.qs" + +#remove garbage. No way to deselect this in installer script. +rm -rf "$TRIK_QT_INSTALL_DIR"/{doc,examples,Uninstaller.app,Uninstaller.dat} + +du -csh "$TRIK_QT_INSTALL_DIR"/* | sort -h diff --git a/buildScripts/github/runVera++.sh b/buildScripts/github/runVera++.sh new file mode 100755 index 0000000000..7ac54396f6 --- /dev/null +++ b/buildScripts/github/runVera++.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -xueo pipefail +BUILDSCRIPTS=$(realpath $(dirname $(realpath "${BASH_SOURCE[0]}"))/..) +tclsh "$BUILDSCRIPTS"/vera++/generatePaths.tcl +vera++ --error -p allRules --root "$BUILDSCRIPTS"/vera++ < "$BUILDSCRIPTS"/vera++/params + +# Dont work in azure +if [ -z "${COMMIT_RANGE+x}" ] +then + if [ -n "${TRAVIS_COMMIT_RANGE+x}" ] + then + COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}" + elif [ -n "${CIRCLE_COMPARE_URL+x}" ] + then + COMMIT_RANGE=$(echo "${CIRCLE_COMPARE_URL}" | cut -d/ -f7) + if [[ $COMMIT_RANGE != *"..."* ]]; then + COMMIT_RANGE="${COMMIT_RANGE}...${COMMIT_RANGE}" + fi + else + COMMIT_RANGE="upstream/master...HEAD" + fi +fi + +git_diff=$( { git diff --diff-filter=d --name-only "${COMMIT_RANGE}" || true ; } \ + | xargs -r file -i | sed -e "s|\(.*\):.*text/x-c.*|\1|g" -e "/:/d") + [[ -z "${git_diff}" ]] || vera++ --error --root "$BUILDSCRIPTS"/vera++ --profile strict <<< "$git_diff" diff --git a/buildScripts/github/test.sh b/buildScripts/github/test.sh new file mode 100755 index 0000000000..2d512eab9e --- /dev/null +++ b/buildScripts/github/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail + +[ -r tests_qrs.7z ] || curl -Lo tests_qrs.7z https://dl.trikset.com/edu/.solutions20200701/testing_small.7z +7z -y x tests_qrs.7z +env ASAN_OPTIONS=${ASAN_OPTIONS:-use_sigaltstack=0:fast_unwind_on_malloc=0:detect_leaks=1:detect_stack_use_after_return=1} \ + LSAN_OPTIONS=${LSAN_OPTIONS:-suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0} \ + QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-minimal} \ + TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} \ + PYTHONMALLOC=${PYTHONMALLOC:-malloc} \ + PYTHONIOENCODING=utf-8 \ + python3.${TRIK_PYTHON3_VERSION_MINOR} "$(dirname $(realpath ${BASH_SOURCE[0]}))"/../tests/fieldstest.py bin/$CONFIG/2D-model testing_small diff --git a/buildScripts/github/vera_translation.sh b/buildScripts/github/vera_translation.sh new file mode 100755 index 0000000000..edb35b198e --- /dev/null +++ b/buildScripts/github/vera_translation.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -xuevo pipefail +TRIK_LINTER_OK=true +if which vera++ >/dev/null 2>&1 ; then buildScripts/azure/runVera++.sh || TRIK_LINTER_OK=false ; fi +LUPDATE=lupdate +which lupdate-pro >/dev/null 2>&1 && LUPDATE=lupdate-pro +$LUPDATE studio.pro plugins/robots/editor/*/translations.pro || TRIK_LINTER_OK=false +buildScripts/azure/checkStatus.sh || TRIK_LINTER_OK=false +"$TRIK_LINTER_OK" From c67aa9dfd3847ec84ec332a29527c858cd61debf Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 09:05:17 +0300 Subject: [PATCH 02/19] Add workflows --- .github/workflows/linux_build.yml | 91 +++++++++++++++++++++++++++++ .github/workflows/macos_build.yml | 96 +++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 .github/workflows/linux_build.yml create mode 100644 .github/workflows/macos_build.yml diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml new file mode 100644 index 0000000000..546c11e989 --- /dev/null +++ b/.github/workflows/linux_build.yml @@ -0,0 +1,91 @@ +name: ubuntu 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: + lint: + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + lint: true + build: false + build_installer: false + + build-ubuntu-release-ccache: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true + + build-ubuntu-debug-ccache: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + config: debug + qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + + build-ubuntu-release-tests: + needs: build-ubuntu-release-ccache + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true + + build-ubuntu-debug-tests: + needs: build-ubuntu-debug-ccache + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + config: debug + qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + + build-ubuntu-installer: + needs: [build-ubuntu-debug-tests, build-ubuntu-release-tests] + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: true + qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml new file mode 100644 index 0000000000..84b8682b68 --- /dev/null +++ b/.github/workflows/macos_build.yml @@ -0,0 +1,96 @@ +name: macOS 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: + lint: + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + lint: true + build: false + build_installer: false + + build-macos-release-ccache: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + executor: "time" + build: true + build_installer: false + qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true + + build-macos-debug-ccache: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + executor: "time" + build: true + build_installer: false + config: debug + qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + + build-macos-release-tests: + needs: build-macos-release-ccache + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + executor: "time" + build: true + build_installer: false + qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true + + build-macos-debug-tests: + needs: build-macos-debug-ccache + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + executor: "time" + build: true + build_installer: false + config: debug + qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + + build-macos-installer: + needs: [build-macos-debug-tests, build-macos-release-tests] + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + executor: "time" + build: true + build_installer: true + qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true From 60124f75680c9f26e74574fb442bd1513196a66e Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 09:08:19 +0300 Subject: [PATCH 03/19] Add template --- .github/workflows/setup_environment.yml | 142 ++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/setup_environment.yml diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml new file mode 100644 index 0000000000..7f60bb75a8 --- /dev/null +++ b/.github/workflows/setup_environment.yml @@ -0,0 +1,142 @@ +name: Set up Action + +on: + workflow_call: + inputs: + os: + required: true + type: string + executor: + required: false + type: string + default: "time docker exec -i builder" + lint: + required: false + type: string + default: 'false' + build: + required: true + type: string + build_installer: + required: true + type: string + trik-qt-version: + required: false + type: string + default: '5.12' + trik-python3-version-minor: + required: false + type: string + default: '9' + qtifw-version: + required: false + type: string + default: '4.6.1' + xcode-version: + required: false + type: string + default: '13.4' + config: + required: false + type: string + default: 'release' + qmake_extra: + required: false + type: string + default: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache" + tests: + required: false + type: string + default: "./run-simulator-tests.sh" + +jobs: + job: + defaults: + run: + shell: bash + + runs-on: ${{ inputs.os }} + steps: + - name: Cancel Previous Workflow Runs + uses: n1hility/cancel-previous-runs@v3.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure git + run: | + git config --global core.symlinks true + git config --global core.autocrlf input + + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Set up environment + run: buildScripts/github/install_${{ runner.os }}.sh + env: + TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} + QTIFW_VERSION: ${{ inputs.qtifw-version }} + XCODE_VERSION: ${{ inputs.xcode-version }} + + - name: Lint + run: ${{ inputs.executor }} buildScripts/github/vera_translation.sh + if: ${{ inputs.lint == 'true' }} + + - name: Restore cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} + key: ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-${{ github.sha }} + restore-keys: | + ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}- + ccache-${{ inputs.os }}-${{ inputs.config }}- + ccache-${{ inputs.os }}- + if: ${{ inputs.build == 'true' }} + + - name: Build + run: buildScripts/github/build.sh + env: + TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} + CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf" + PROJECT: "studio" + CONFIG: ${{ inputs.config }} + EXECUTOR: ${{ inputs.executor }} + QMAKE_EXTRA: ${{ inputs.qmake_extra }} + TESTS: ${{ inputs.tests }} + if: ${{ inputs.build == 'true' }} + + - name: Build Installer + run: buildScripts/azure/test.sh && buildScripts/github/build_installer.sh + env: + TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} + CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf" + PROJECT: "studio" + CONFIG: ${{ inputs.config }} + EXECUTOR: ${{ inputs.executor }} + QMAKE_EXTRA: ${{ inputs.qmake_extra }} + TESTS: ${{ inputs.tests }} + BRANCH_NAME: ${{ github.event.pull_request.head.ref }} + PULLREQUESTNUMBER: ${{ github.event.pull_request.number }} + password: ${{ secrets.password }} + server: ${{ secrets.server }} + if: ${{ inputs.build_installer == 'true' }} + + - name: Upload installer artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }}-installer + path: installer/ + if: ${{ inputs.build_installer == 'true' }} + + # - name: Save cache + # uses: actions/cache/save@v4 + # with: + # path: ${{ github.workspace }}/.ccache/${{ matrix.os }}-${{ matrix.config }} + # key: ccache-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.qmake_extra }}-${{ github.sha }} From 595aac0d784bb0b6eac8a9a09cb10e173bea36ef Mon Sep 17 00:00:00 2001 From: MinyazevR <89993880+MinyazevR@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:12:46 +0300 Subject: [PATCH 04/19] Add lint before build Add lint before build --- .github/workflows/rockylinux.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/rockylinux.yml b/.github/workflows/rockylinux.yml index bf0e1d8c84..e265c54dc9 100644 --- a/.github/workflows/rockylinux.yml +++ b/.github/workflows/rockylinux.yml @@ -29,7 +29,15 @@ on: workflow_dispatch: jobs: + lint: + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + lint: true + build: false + build_installer: false build: + needs: lint runs-on: ubuntu-latest container: rockylinux:9 defaults: From 445324e4965d218e27ef12f97215fd76783527f5 Mon Sep 17 00:00:00 2001 From: MinyazevR <89993880+MinyazevR@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:53:10 +0300 Subject: [PATCH 05/19] Change configpath Change ccache configpath --- .github/workflows/setup_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 7f60bb75a8..6288a42310 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -116,7 +116,7 @@ jobs: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} - CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf" + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} EXECUTOR: ${{ inputs.executor }} From 9370f1fc7f87d9022bdd20d867ae31e45034cec9 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 10:25:43 +0300 Subject: [PATCH 06/19] change config --- .github/workflows/linux_build.yml | 2 +- .github/workflows/macos_build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 546c11e989..7135b832f7 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -59,6 +59,7 @@ jobs: build_installer: false config: debug qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + tests: true build-ubuntu-release-tests: needs: build-ubuntu-release-ccache @@ -68,7 +69,6 @@ jobs: build: true build_installer: false qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - tests: true build-ubuntu-debug-tests: needs: build-ubuntu-debug-ccache diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 84b8682b68..8054432381 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -61,6 +61,7 @@ jobs: build_installer: false config: debug qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + tests: true build-macos-release-tests: needs: build-macos-release-ccache @@ -71,7 +72,6 @@ jobs: build: true build_installer: false qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - tests: true build-macos-debug-tests: needs: build-macos-debug-ccache From a597f3d7e02532f85f69f17c72d354d0ec2e644b Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 12:28:23 +0300 Subject: [PATCH 07/19] Run test in executor --- .github/workflows/setup_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 6288a42310..63e038b8a1 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -111,7 +111,7 @@ jobs: if: ${{ inputs.build == 'true' }} - name: Build Installer - run: buildScripts/azure/test.sh && buildScripts/github/build_installer.sh + run: ${{ inputs.executor }} env CONFIG=${{ inputs.config }} buildScripts/github/test.sh && buildScripts/github/build_installer.sh env: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} From e9d72043d9d8e4ddd03c1d3c505543592a495b8e Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 13:18:15 +0300 Subject: [PATCH 08/19] fix stupid bug --- .github/workflows/setup_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 63e038b8a1..c73bc024b0 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -102,7 +102,7 @@ jobs: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} - CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf" + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} EXECUTOR: ${{ inputs.executor }} From a4537fcc9c616e1f87cddbba40ba0244fb515d83 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 14:59:13 +0300 Subject: [PATCH 09/19] Compatible with github actions --- buildScripts/github/build_installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index 2668cc6f5d..0cca96d6d2 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -19,7 +19,7 @@ df -h . NEED_DEPLOY=$([[ "$GITHUB_REPOSITORY" == "trikset/trik-studio" && "${PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false ) -if [[ $AGENT_OS == Linux ]] ; then +if [[ $RUNNER_OS == Linux ]] ; then echo Start build checker archive $EXECUTOR bash -ic "bin/$CONFIG/build-checker-installer.sh" if $NEED_DEPLOY ; then From 13e31ef7d0ef0fe41430964b4e17990bbe69e60b Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 22 Jul 2024 15:36:31 +0300 Subject: [PATCH 10/19] Add ASAN --- buildScripts/github/build_internal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildScripts/github/build_internal.sh b/buildScripts/github/build_internal.sh index 619816870e..c8175e61be 100755 --- a/buildScripts/github/build_internal.sh +++ b/buildScripts/github/build_internal.sh @@ -32,7 +32,7 @@ make -j $(nproc) all 2>&1 | tee -a build.log ccache -s ls bin/$CONFIG export QT_QPA_PLATFORM=minimal -export ASAN_OPTIONS=$(if [[ $AGENT_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0 +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0 export LSAN_OPTIONS=suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0 export DISPLAY=:0 export TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} From 11ae643ce3d6667d80e6473d79faafe548797d1d Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Tue, 23 Jul 2024 00:21:20 +0300 Subject: [PATCH 11/19] Add warn-off for all macos config and disallow trik_nopython --- .github/workflows/linux_build.yml | 10 +++++----- .github/workflows/macos_build.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 7135b832f7..6c9bc8e57c 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -47,7 +47,7 @@ jobs: os: ubuntu-latest build: true build_installer: false - qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" tests: true build-ubuntu-debug-ccache: @@ -58,7 +58,7 @@ jobs: build: true build_installer: false config: debug - qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" tests: true build-ubuntu-release-tests: @@ -68,7 +68,7 @@ jobs: os: ubuntu-latest build: true build_installer: false - qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" build-ubuntu-debug-tests: needs: build-ubuntu-debug-ccache @@ -78,7 +78,7 @@ jobs: build: true build_installer: false config: debug - qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" build-ubuntu-installer: needs: [build-ubuntu-debug-tests, build-ubuntu-release-tests] @@ -87,5 +87,5 @@ jobs: os: ubuntu-latest build: true build_installer: true - qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" tests: true diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 8054432381..29c847ad7d 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -48,7 +48,7 @@ jobs: executor: "time" build: true build_installer: false - qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" tests: true build-macos-debug-ccache: @@ -60,7 +60,7 @@ jobs: build: true build_installer: false config: debug - qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + qmake_extra: "CONFIG+=warn_off CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" tests: true build-macos-release-tests: @@ -71,7 +71,7 @@ jobs: executor: "time" build: true build_installer: false - qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" build-macos-debug-tests: needs: build-macos-debug-ccache @@ -82,7 +82,7 @@ jobs: build: true build_installer: false config: debug - qmake_extra: "CONFIG+=trik_nopython CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" build-macos-installer: needs: [build-macos-debug-tests, build-macos-release-tests] @@ -92,5 +92,5 @@ jobs: executor: "time" build: true build_installer: true - qmake_extra: "CONFIG+=trik_nopython CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" tests: true From bcfe1bb9abaaf48e777a17b8fb234f1b4bea8b7a Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Tue, 23 Jul 2024 02:34:36 +0300 Subject: [PATCH 12/19] Change ccache path --- .github/workflows/setup_environment.yml | 24 +++++++++++++----------- buildScripts/github/build_installer.sh | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index c73bc024b0..a3be4b77d0 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -48,31 +48,31 @@ on: required: false type: string default: "./run-simulator-tests.sh" - + jobs: job: defaults: run: shell: bash - + runs-on: ${{ inputs.os }} steps: - name: Cancel Previous Workflow Runs uses: n1hility/cancel-previous-runs@v3.0 with: token: ${{ secrets.GITHUB_TOKEN }} - + - name: Configure git run: | git config --global core.symlinks true git config --global core.autocrlf input - + - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - + - name: Set up environment run: buildScripts/github/install_${{ runner.os }}.sh env: @@ -80,7 +80,7 @@ jobs: TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} QTIFW_VERSION: ${{ inputs.qtifw-version }} XCODE_VERSION: ${{ inputs.xcode-version }} - + - name: Lint run: ${{ inputs.executor }} buildScripts/github/vera_translation.sh if: ${{ inputs.lint == 'true' }} @@ -88,7 +88,7 @@ jobs: - name: Restore cache uses: actions/cache@v4 with: - path: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} + path: $HOME/.ccache/${{ inputs.os }}-${{ inputs.config }} key: ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-${{ github.sha }} restore-keys: | ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}- @@ -101,7 +101,7 @@ jobs: env: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} + CCACHE_DIR: $HOME/.ccache/${{ inputs.os }}-${{ inputs.config }} CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} @@ -109,13 +109,15 @@ jobs: QMAKE_EXTRA: ${{ inputs.qmake_extra }} TESTS: ${{ inputs.tests }} if: ${{ inputs.build == 'true' }} - + - name: Build Installer - run: ${{ inputs.executor }} env CONFIG=${{ inputs.config }} buildScripts/github/test.sh && buildScripts/github/build_installer.sh + run: | + BRANCH_NAME=${BRANCH_NAME//\//-} + ${{ inputs.executor }} env CONFIG=${{ inputs.config }} buildScripts/github/test.sh && buildScripts/github/build_installer.sh env: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} + CCACHE_DIR: $HOME/.ccache/${{ inputs.os }}-${{ inputs.config }} CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index 0cca96d6d2..28bd59d45c 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -3,7 +3,7 @@ set -euxo pipefail BRANCH_NAME="${BRANCH_NAME:-${GITHUB_REF#refs/heads/}}" QTBIN=${QTBIN:-$($EXECUTOR bash -c 'eval $(make qmake -n | cut -f 1 -d " ") -query QT_INSTALL_BINS')} case $RUNNER_OS in - Darwin) + macOS) QTIFWBIN=$HOME/qtifw/bin TSNAME=trik-studio-installer-mac-$BRANCH_NAME.dmg # export TRIK_PYTHON3_VERSION_MINOR="$(python3 -V | sed 's#^Python 3\.\([0-9]+\)\.[0-9]+$#\1#g')" From b91fd86d5c93de8b3716f901571ebf47c6fcc790 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Tue, 23 Jul 2024 04:50:29 +0300 Subject: [PATCH 13/19] Save artifacts --- .github/workflows/setup_environment.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index a3be4b77d0..2b8c5c2618 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -131,10 +131,13 @@ jobs: if: ${{ inputs.build_installer == 'true' }} - name: Upload installer artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-installer - path: installer/ + path: | + installer/*.exe + installer/*.run + installer/*.dmg if: ${{ inputs.build_installer == 'true' }} # - name: Save cache From d67b76fe37e5ebe591bf4f0baf55b99b02563a5a Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Tue, 23 Jul 2024 04:50:56 +0300 Subject: [PATCH 14/19] Change ccache config --- buildScripts/github/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/buildScripts/github/build.sh b/buildScripts/github/build.sh index 55d812c520..253a7e2ae3 100755 --- a/buildScripts/github/build.sh +++ b/buildScripts/github/build.sh @@ -28,6 +28,7 @@ EOF $EXECUTOR env \ CCACHE_CONFIGPATH="$CCACHE_CONFIGPATH" \ +CCACHE_DIR="$CCACHE_DIR" \ CONFIG="$CONFIG" \ QMAKE_EXTRA="$QMAKE_EXTRA" \ PROJECT="$PROJECT" \ From e989c80c327d9e2bc6dc088d9916c0b13803347c Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Tue, 23 Jul 2024 05:21:21 +0300 Subject: [PATCH 15/19] Fix ccache problem --- .github/workflows/setup_environment.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 2b8c5c2618..888aea6743 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -88,7 +88,7 @@ jobs: - name: Restore cache uses: actions/cache@v4 with: - path: $HOME/.ccache/${{ inputs.os }}-${{ inputs.config }} + path: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} key: ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-${{ github.sha }} restore-keys: | ccache-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}- @@ -101,7 +101,7 @@ jobs: env: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - CCACHE_DIR: $HOME/.ccache/${{ inputs.os }}-${{ inputs.config }} + CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} @@ -117,7 +117,7 @@ jobs: env: TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - CCACHE_DIR: $HOME/.ccache/${{ inputs.os }}-${{ inputs.config }} + CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-${{ inputs.config }} CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} @@ -140,8 +140,3 @@ jobs: installer/*.dmg if: ${{ inputs.build_installer == 'true' }} - # - name: Save cache - # uses: actions/cache/save@v4 - # with: - # path: ${{ github.workspace }}/.ccache/${{ matrix.os }}-${{ matrix.config }} - # key: ccache-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.qmake_extra }}-${{ github.sha }} From 3a1737ab2c01605023dcf0cf8331461b8bb9d53a Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Tue, 23 Jul 2024 09:07:32 +0300 Subject: [PATCH 16/19] Add application/gzip --- buildScripts/github/build_internal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildScripts/github/build_internal.sh b/buildScripts/github/build_internal.sh index c8175e61be..d712b7fc7f 100755 --- a/buildScripts/github/build_internal.sh +++ b/buildScripts/github/build_internal.sh @@ -24,7 +24,7 @@ ccache -sz { which python && python -V || true ; } export PKG_CONFIG_PATH=$(python3.${TRIK_PYTHON3_VERSION_MINOR}-config --prefix)/lib/pkgconfig rm -f .qmake.cache -{ echo -n 'Remove broken object files ' ; find . -name '*.o' -type f -print0 | xargs -0 file --mime-type | grep -v 'application/x-object' | cut -f 1 -d ':' | xargs -t rm -f _RM_REQUIRES_ARGUMENTS_BUT_BSD_XARGS_IS_MISSING_R_PARAMETER_ARGUMENT || : ; echo Done ; } +{ echo -n 'Remove broken object files ' ; find . -name '*.o' -type f -print0 | xargs -0 file --mime-type | grep -v -e 'application/x-object' -e 'application/gzip' | cut -f 1 -d ':' | xargs -t rm -f _RM_REQUIRES_ARGUMENTS_BUT_BSD_XARGS_IS_MISSING_R_PARAMETER_ARGUMENT || : ; echo Done ; } qmake -Wall PYTHON3_VERSION_MINOR=$TRIK_PYTHON3_VERSION_MINOR CONFIG+=$CONFIG $QMAKE_EXTRA $PROJECT.pro make -j $(nproc) qmake_all 2>&1 | tee -a build.log ccache -s From a0b44e820484b7c8408f621398754714a59a014e Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 25 Jul 2024 15:41:27 +0300 Subject: [PATCH 17/19] No need for compatibility and azure/travis removal --- .circleci/config.yml | 42 --- azure-pipelines.yml | 261 ------------------ buildScripts/appveyor/git.cmd | 1 - buildScripts/azure/build.sh | 43 --- buildScripts/azure/build_installer.sh | 36 --- buildScripts/azure/build_internal.sh | 41 --- buildScripts/azure/checkStatus.sh | 13 - buildScripts/azure/install_Darwin.sh | 20 -- buildScripts/azure/install_Linux.sh | 5 - buildScripts/azure/install_qtifw_mac.sh | 16 -- buildScripts/azure/runVera++.sh | 27 -- buildScripts/azure/test.sh | 12 - buildScripts/azure/vera_translation.sh | 9 - buildScripts/github/build_internal.sh | 14 +- buildScripts/travis/after_script.sh | 7 - buildScripts/travis/before_install.sh | 12 - buildScripts/travis/build_installer.sh | 40 --- buildScripts/travis/checkStatus.sh | 13 - buildScripts/travis/has_only_skipped_files.sh | 8 - buildScripts/travis/install_linux.sh | 4 - buildScripts/travis/install_osx.sh | 12 - buildScripts/travis/install_qtifw_mac.sh | 14 - buildScripts/travis/runVera++.sh | 24 -- buildScripts/travis/run_clean_env_test.sh | 19 -- buildScripts/travis/script.sh | 55 ---- buildScripts/travis/test.sh | 10 - buildScripts/travis/vera_translation.sh | 9 - 27 files changed, 1 insertion(+), 766 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 azure-pipelines.yml delete mode 100644 buildScripts/appveyor/git.cmd delete mode 100755 buildScripts/azure/build.sh delete mode 100755 buildScripts/azure/build_installer.sh delete mode 100755 buildScripts/azure/build_internal.sh delete mode 100755 buildScripts/azure/checkStatus.sh delete mode 100755 buildScripts/azure/install_Darwin.sh delete mode 100755 buildScripts/azure/install_Linux.sh delete mode 100755 buildScripts/azure/install_qtifw_mac.sh delete mode 100755 buildScripts/azure/runVera++.sh delete mode 100755 buildScripts/azure/test.sh delete mode 100755 buildScripts/azure/vera_translation.sh delete mode 100755 buildScripts/travis/after_script.sh delete mode 100755 buildScripts/travis/before_install.sh delete mode 100755 buildScripts/travis/build_installer.sh delete mode 100755 buildScripts/travis/checkStatus.sh delete mode 100755 buildScripts/travis/has_only_skipped_files.sh delete mode 100755 buildScripts/travis/install_linux.sh delete mode 100755 buildScripts/travis/install_osx.sh delete mode 100755 buildScripts/travis/install_qtifw_mac.sh delete mode 100755 buildScripts/travis/runVera++.sh delete mode 100755 buildScripts/travis/run_clean_env_test.sh delete mode 100755 buildScripts/travis/script.sh delete mode 100755 buildScripts/travis/test.sh delete mode 100755 buildScripts/travis/vera_translation.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ddbf28ebe4..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference -version: 2.1 -# Use a package of configuration called an orb. -orbs: - # Declare a dependency on the welcome-orb - welcome: circleci/welcome-orb@0.4.1 -jobs: - lint: - docker: - - image: trikset/linux-builder - shell: /bin/bash -leo pipefail - environment: - - BASH_ENV: /etc/profile - steps: - - run: Xfvb :0 & - - checkout - - run: git submodule update --init --recursive --jobs 4 --depth 1 --single-branch - - run: buildScripts/travis/vera_translation.sh -# build: -# docker: -# - image: trikset/linux-builder -# steps: -# - checkout -# - run: buildScripts/travis/script.sh - -workflows: - # Name the workflow "welcome" - welcome: - # Run the welcome/run job in its own container - jobs: - - welcome/run - main: - jobs: - - lint -# - build: -# requires: -# - lint -# - test: -# requires: -# - build - - diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 182a60e3b7..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,261 +0,0 @@ -trigger: - branches: - include: - - master - - junior - tags: - include: - - '*' - -variables: - CONFIG: release - QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache" - EXECUTOR: "time docker exec -i builder" - PROJECT: studio - TESTS: true - ALL_TESTS: "./run-simulator-tests.sh" - TRIK_PYTHON3_VERSION_MINOR: 9 - TRIK_QT_VERSION: 5.12 - BUILD_TIMEOUT: 2400 - CCACHE_CONFIGPATH: "$(Pipeline.Workspace)/ccache.conf" - CCACHE_DIR: "$(Pipeline.Workspace)/.ccache/$(Agent.OS)-$(CONFIG)" - -parameters: - - name: checkoutStep - type: step - default: - checkout: self - fetchDepth: 100 - submodules: recursive - - - name: gitListStep - type: step - default: - bash: | - git tag -l - git branch -a - displayName: Set up the environment - - - name: environmentStep - type: step - default: - bash: buildScripts/azure/install_$(Agent.OS).sh - displayName: Set up the environment - - - name: cacheStep - type: step - default: - task: Cache@2 - inputs: - key: '"ccache-$(Agent.OS)-$(CONFIG)" | "$(Build.SourceVersion)" | "$(QMAKE_EXTRA)"' - path: $(CCACHE_DIR) - restoreKeys: | - "ccache-$(Agent.OS)-$(CONFIG)" | "$(Build.SourceVersion)" | "$(QMAKE_EXTRA)" - "ccache-$(Agent.OS)-$(CONFIG)" | "$(Build.SourceVersion)" - "ccache-$(Agent.OS)-$(CONFIG)" | "$(QMAKE_EXTRA)" - "ccache-$(Agent.OS)-$(CONFIG)" - displayName: Process caches - - - name: buildNoTestsStep - type: step - default: - bash: | - buildScripts/azure/build.sh & WPID=$! - sleep $BUILD_TIMEOUT && { echo -e "\033[31;1;7m***KILLED ON TIMEOUT***\033[0m" ; echo "##vso[task.setvariable variable=isTimeout;isOutput=true]Yes" ; pkill -TERM -P $WPID ; } & KPID=$! - wait $WPID ; kill $KPID > /dev/null || true - displayName: 'Build without tests' - - - name: buildWithTestsStep - type: step - default: - bash: buildScripts/azure/build.sh - displayName: 'Build with buildWithTests.sh' - - - name: buildInstallerStep - type: step - default: - bash: $EXECUTOR env CONFIG=$CONFIG AGENT_OS=$(Agent.OS) ./buildScripts/azure/test.sh && buildScripts/azure/build_installer.sh - env: - password: $(SERVER_PASSWORD) - server: $(SERVER_NAME) - displayName: 'Build installer and deploy' - - - name: setTagNameStep - type: step - default: - bash: export BRANCH_NAME="$(git describe --exact-match $(Build.SourceVersion))" - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') - displayName: 'Tag name as an environment variable' - - - name: publishInstallerArtifact - type: step - default: - publish: installer/ - artifact: "$(Agent.OS) installer" - -stages: -- stage: lintStage - displayName: Lint stage - jobs: - - job: Lint - pool: - vmImage: ubuntu-latest - - steps: - - ${{ parameters.checkoutStep }} - - - bash: buildScripts/azure/install_$(Agent.OS).sh - displayName: 'Set up the environment' - - - bash: $EXECUTOR buildScripts/azure/vera_translation.sh - displayName: 'vera_translation.sh' - -- stage: linuxCacheableBuildStage - displayName: Linux cache build - dependsOn: lintStage - condition: succeeded() - jobs: - - job: Build - strategy: - matrix: - LinuxRelease: - imageName: 'ubuntu-latest' - QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - LinuxDebug: - imageName: 'ubuntu-latest' - QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - CONFIG: debug - TESTS: $ALL_TESTS - pool: - vmImage: $(imageName) - - steps: - - ${{ parameters.checkoutStep }} - - ${{ parameters.environmentStep }} - - ${{ parameters.cacheStep }} - - ${{ parameters.buildNoTestsStep }} - -- stage: macOSCacheableBuildStage - displayName: MacOS cache build - dependsOn: lintStage - condition: succeeded() - jobs: - - job: Build - strategy: - matrix: - macOSRelease: - imageName: 'macOS-11' - QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - EXECUTOR: "time" - macOSDebug: - imageName: 'macOS-11' - QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - CONFIG: debug - TESTS: $ALL_TESTS - EXECUTOR: "time" - pool: - vmImage: $(imageName) - - steps: - - ${{ parameters.checkoutStep }} - - ${{ parameters.environmentStep }} - - ${{ parameters.cacheStep }} - - ${{ parameters.buildNoTestsStep }} - -- stage: linuxBuildWithTestsStage - displayName: Linux build with tests - dependsOn: linuxCacheableBuildStage - condition: and(succeeded(),and(ne(stageDependencies.linuxCacheableBuildStage.Build.outputs['LinuxRelease.BuildNoTestsStep.isTimeout'],'Yes'),ne(stageDependencies.linuxCacheableBuildStage.Build.outputs['LinuxDebug.BuildNoTestsStep.isTimeout'],'Yes'))) - jobs: - - job: Build - strategy: - matrix: - Linux release + tests: - imageName: 'ubuntu-latest' - QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - Linux release with retired features: - imageName: 'ubuntu-latest' - QMAKE_EXTRA: "CONFIG+=trik_retired_features CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent" - Linux debug + tests: - imageName: 'ubuntu-latest' - QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - CONFIG: debug - TESTS: $ALL_TESTS - pool: - vmImage: $(imageName) - - steps: - - ${{ parameters.checkoutStep }} - - ${{ parameters.environmentStep }} - - ${{ parameters.cacheStep }} - - ${{ parameters.buildWithTestsStep }} - -- stage: macOSBuildWithTestsStage - displayName: MacOs build with tests - dependsOn: macOSCacheableBuildStage - condition: and(succeeded(),and(ne(stageDependencies.macOSCacheableBuildStage.Build.outputs['macOSRelease.BuildNoTestsStep.isTimeout'],'Yes'),ne(stageDependencies.macOSCacheableBuildStage.Build.outputs['macOSDebug.BuildNoTestsStep.isTimeout'],'Yes'))) - jobs: - - job: Build - strategy: - matrix: - MacOS release + tests: - imageName: 'macOS-11' - QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - EXECUTOR: "time" - macOS debug + tests: - imageName: 'macOS-11' - QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - CONFIG: debug - TESTS: $ALL_TESTS - EXECUTOR: "time" - pool: - vmImage: $(imageName) - - steps: - - ${{ parameters.checkoutStep }} - - ${{ parameters.environmentStep }} - - ${{ parameters.cacheStep }} - - ${{ parameters.buildWithTestsStep }} - -- stage: linuxInstallerStage - displayName: Linux installer - dependsOn: linuxBuildWithTestsStage - condition: succeeded() - jobs: - - job: installer - displayName: "Test, installer, deploy" - variables: - QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - pool: - vmImage: 'ubuntu-latest' - - steps: - - ${{ parameters.checkoutStep }} - - ${{ parameters.environmentStep }} - - ${{ parameters.cacheStep }} - - ${{ parameters.buildNoTestsStep }} - - ${{ parameters.setTagNameStep }} - - ${{ parameters.buildInstallerStep }} - - ${{ parameters.publishInstallerArtifact }} - -- stage: macOsInstallerStage - displayName: MacOs installer - dependsOn: macOSBuildWithTestsStage - condition: succeeded() - jobs: - - job: installer - displayName: "Test, installer, deploy" - variables: - QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - EXECUTOR: "time" - pool: - vmImage: 'macOS-11' - - steps: - - ${{ parameters.checkoutStep }} - - ${{ parameters.environmentStep }} - - ${{ parameters.cacheStep }} - - ${{ parameters.buildNoTestsStep }} - - ${{ parameters.setTagNameStep }} - - ${{ parameters.buildInstallerStep }} - - ${{ parameters.publishInstallerArtifact }} diff --git a/buildScripts/appveyor/git.cmd b/buildScripts/appveyor/git.cmd deleted file mode 100644 index 729620074a..0000000000 --- a/buildScripts/appveyor/git.cmd +++ /dev/null @@ -1 +0,0 @@ -@cmd.exe /c "set "PATH=C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;%PATH%" && git %*" diff --git a/buildScripts/azure/build.sh b/buildScripts/azure/build.sh deleted file mode 100755 index 711c804655..0000000000 --- a/buildScripts/azure/build.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -set -uxeo pipefail - -CODECOV=true -case $AGENT_OS in - Darwin) - QT_DIR=$(ls -dv "$HOME"/Qt/${TRIK_QT_VERSION}*/*/bin | head -n 1) - [ -d "$QT_DIR" ] && export PATH="$QT_DIR:$PATH" - export PATH="/usr/local/opt/ccache/libexec:$PATH" - export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" - echo "Now path is $PATH" - ;; - Linux) - # if [[ "$TESTS" != "true" ]] ; then CODECOV="$EXECUTOR bash -ic \" python -m codecov \" " ; fi - ;; - *) exit 1 ;; -esac - -mkdir -p $CCACHE_DIR || sudo chown -R $USER $CCACHE_DIR || : -cat << EOF > $CCACHE_CONFIGPATH -compiler_check=content -run_second_cpp=true -cache_dir=$CCACHE_DIR -compression=true -compression_level=1 -sloppiness=time_macros,pch_defines,include_file_ctime,include_file_mtime,file_stat_matches -max_size=1200M -EOF - -$EXECUTOR env \ -CCACHE_CONFIGPATH="$CCACHE_CONFIGPATH" \ -CONFIG="$CONFIG" \ -QMAKE_EXTRA="$QMAKE_EXTRA" \ -PROJECT="$PROJECT" \ -AGENT_OS="$AGENT_OS" \ -TESTS="$TESTS" \ -buildScripts/azure/build_internal.sh - - -df -h . -$EXECUTOR bash -ic buildScripts/azure/checkStatus.sh - -$CODECOV diff --git a/buildScripts/azure/build_installer.sh b/buildScripts/azure/build_installer.sh deleted file mode 100755 index 27b380dd22..0000000000 --- a/buildScripts/azure/build_installer.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -euxo pipefail -BRANCH_NAME="${BRANCH_NAME:-$BUILD_SOURCEBRANCHNAME}" -QTBIN=${QTBIN:-$($EXECUTOR bash -c 'eval $(make qmake -n | cut -f 1 -d " ") -query QT_INSTALL_BINS')} -case $AGENT_OS in - Darwin) - QTIFWBIN=$HOME/qtifw/bin - TSNAME=trik-studio-installer-mac-$BRANCH_NAME.dmg -# export TRIK_PYTHON3_VERSION_MINOR="$(python3 -V | sed 's#^Python 3\.\([0-9]+\)\.[0-9]+$#\1#g')" - ;; - Linux) - QTIFWBIN=/opt/qtifw/bin - #QTIFWBIN=$($EXECUTOR bash -c 'find /Qt/Tools/QtInstallerFramework/ -maxdepth 2 -name bin -type d -print0 | sort -Vrz | head -zn 1') - TSNAME=trik-studio-installer-linux-$BRANCH_NAME.run - ;; - *) exit 1 ;; -esac -df -h . - -NEED_DEPLOY=$([[ "$BUILD_REPOSITORY_NAME" == "trikset/trik-studio" && "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false ) - -if [[ $AGENT_OS == Linux ]] ; then - echo Start build checker archive - $EXECUTOR bash -ic "bin/$CONFIG/build-checker-installer.sh" - if $NEED_DEPLOY ; then - $EXECUTOR bash -ic "sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' bin/$CONFIG/trik_checker.tar.xz $server:dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME.tar.xz" - fi -fi -echo Start build installer -$EXECUTOR bash -ic "installer/build-trik-studio.sh $QTBIN $QTIFWBIN ." - -if $NEED_DEPLOY ; then - $EXECUTOR bash -ic "\ - mv installer/trik-studio*installer* installer/$TSNAME \ - && sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' installer/$TSNAME $server:dl/ts/fresh/installer/" -fi diff --git a/buildScripts/azure/build_internal.sh b/buildScripts/azure/build_internal.sh deleted file mode 100755 index 6a93a9f3d6..0000000000 --- a/buildScripts/azure/build_internal.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -#This is a magic fix for macOS, but old Linux /usr/bin/env has no -S option, thus we cannot use shabang line -#An obsolete bash (v3) does not support `exec {varname}<>`, thus we want to use zsh -if ! ( eval 'exec {somevar}<>$(mktemp)' ) ; then - COMPATIBLE_SHELL=/bin/zsh - [ ! -x $COMPATIBLE_SHELL ] && COMPATIBLE_SHELL=/bin/bash || : - exec $COMPATIBLE_SHELL "$0" "$@" -fi - -# enable kinda `bash compatibility` in zsh -if [ -n "$ZSH_VERSION" ] ; then setopt SH_WORD_SPLIT ; fi - -set -xueo pipefail -exec {lock}<>$(mktemp -t trik-build-lock.XXXX) && trap 'while [ -e /proc/$$/fd/$lock ] && [ $(lsof -t /proc/$$/fd/$lock | wc -l) -ne 3 ] ; do echo "Sleep to wait ..." ; lsof /proc/$$/fd/$lock ; sleep 5 ; done' EXIT -export LANG=C -ccache -V && ccache -p -which g++ -g++ --version -which qmake -qmake -query -ccache -sz -{ which python3 && python3 -V || true ; } -{ which python && python -V || true ; } -export PKG_CONFIG_PATH=$(python3.${TRIK_PYTHON3_VERSION_MINOR}-config --prefix)/lib/pkgconfig -rm -f .qmake.cache -{ echo -n 'Remove broken object files ' ; find . -name '*.o' -type f -print0 | xargs -0 file --mime-type | grep -v 'application/x-object' | cut -f 1 -d ':' | xargs -t rm -f _RM_REQUIRES_ARGUMENTS_BUT_BSD_XARGS_IS_MISSING_R_PARAMETER_ARGUMENT || : ; echo Done ; } -qmake -Wall PYTHON3_VERSION_MINOR=$TRIK_PYTHON3_VERSION_MINOR CONFIG+=$CONFIG $QMAKE_EXTRA $PROJECT.pro -make -j2 qmake_all 2>&1 | tee -a build.log -ccache -s -make -j2 all 2>&1 | tee -a build.log -ccache -s -ls bin/$CONFIG -export QT_QPA_PLATFORM=minimal -export ASAN_OPTIONS=$(if [[ $AGENT_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0 -export LSAN_OPTIONS=suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0 -export DISPLAY=:0 -export TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} -export PYTHONMALLOC=malloc -env -make check -k -s && ( set +eux ; cd "bin/$CONFIG" && eval "$TESTS" ) diff --git a/buildScripts/azure/checkStatus.sh b/buildScripts/azure/checkStatus.sh deleted file mode 100755 index 4ba37d29e7..0000000000 --- a/buildScripts/azure/checkStatus.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -gitStatus=$(git status -s && git submodule --quiet foreach --recursive git status -s) -if [ ! -z "$gitStatus" ] -then - echo $gitStatus - echo git status must be clean - git diff --minimal - false -else - true -fi - - diff --git a/buildScripts/azure/install_Darwin.sh b/buildScripts/azure/install_Darwin.sh deleted file mode 100755 index f2f2c1b2c5..0000000000 --- a/buildScripts/azure/install_Darwin.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - set -euo pipefail - export HOMEBREW_NO_INSTALL_CLEANUP=1 - export HOMEBREW_NO_AUTO_UPDATE=1 - brew tap "hudochenkov/sshpass" - TRIK_BREW_PACKAGES="ccache coreutils libusb pkg-config gnu-sed sshpass p7zip python@3.${TRIK_PYTHON3_VERSION_MINOR}" - for pkg in $TRIK_BREW_PACKAGES ; do - p="${pkg##*/}" - p="${p%.*}" - brew install "$pkg" || brew upgrade "$pkg" || brew link --force "$pkg" || echo "Failed to install/upgrade $pkg" - done - TRIK_PYTHON=python3.${TRIK_PYTHON3_VERSION_MINOR} - "$TRIK_PYTHON" -m pip install -U pip - "$TRIK_PYTHON" -m pip install aqtinstall - "$TRIK_PYTHON" -m aqt install-qt -m qtscript -O "$HOME/Qt" mac desktop "${TRIK_QT_VERSION}" - [ -d $HOME/qtifw ] || env TRIK_QT_INSTALL_DIR="$HOME/qtifw" "$(dirname $(realpath ${BASH_SOURCE[0]}))"/install_qtifw_mac.sh - # Force SDK version compatible with Qt 5.12 - sudo xcode-select -s /Applications/Xcode_11.7.app/Contents/Developer - xcodebuild -showsdks - xcrun -sdk macosx --show-sdk-path diff --git a/buildScripts/azure/install_Linux.sh b/buildScripts/azure/install_Linux.sh deleted file mode 100755 index de4308162a..0000000000 --- a/buildScripts/azure/install_Linux.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - set -euxo pipefail - docker pull trikset/linux-builder - docker run --cap-add SYS_PTRACE -d -v $HOME:$HOME:rw -w `pwd` --name builder trikset/linux-builder Xvfb :0 - docker exec builder git config --global --add safe.directory '*' diff --git a/buildScripts/azure/install_qtifw_mac.sh b/buildScripts/azure/install_qtifw_mac.sh deleted file mode 100755 index a540c1a896..0000000000 --- a/buildScripts/azure/install_qtifw_mac.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -x -TRIK_QT_INSTALL_DIR=${TRIK_QT_INSTALL_DIR:-$HOME/TRIK_QtIfw} -SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) -set -ueo pipefail -#The latest with Qt 5.12 as minimal required, 4.3.0 requires Qt 5.15 -QTIFW_VERSION=4.6.1 -D=/tmp/qtifw-installer.dmg -test -r "$D" || curl -L -o "$D" "http://download.qt-project.org/official_releases/qt-installer-framework/$QTIFW_VERSION/QtInstallerFramework-macOS-x64-${QTIFW_VERSION}.dmg" -P=$(hdiutil attach "$D" -noverify -noautofsck | grep -o '/Volumes/.*$') -I=$(find "$P" -type f -perm +1 -path '*Contents/MacOS/*' -print | head -n 1 ) -env TRIK_QT_INSTALL_DIR="$TRIK_QT_INSTALL_DIR" "$I" --verbose --no-force-installations --show-virtual-components --script "$SCRIPT_DIR/../../plugins/robots/thirdparty/trikRuntime/trikRuntime/docker/qt_scriptinstall.qs" - -#remove garbage. No way to deselect this in installer script. -rm -rf "$TRIK_QT_INSTALL_DIR"/{doc,examples,Uninstaller.app,Uninstaller.dat} - -du -csh "$TRIK_QT_INSTALL_DIR"/* | sort -h diff --git a/buildScripts/azure/runVera++.sh b/buildScripts/azure/runVera++.sh deleted file mode 100755 index ee4f9af891..0000000000 --- a/buildScripts/azure/runVera++.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -xueo pipefail -BUILDSCRIPTS=$(realpath $(dirname $(realpath "${BASH_SOURCE[0]}"))/..) -tclsh "$BUILDSCRIPTS"/vera++/generatePaths.tcl -vera++ --error -p allRules --root "$BUILDSCRIPTS"/vera++ < "$BUILDSCRIPTS"/vera++/params - -# Dont work in azure -if [ -z "${COMMIT_RANGE+x}" ] -then - if [ -n "${TRAVIS_COMMIT_RANGE+x}" ] - then - COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}" - elif [ -n "${CIRCLE_COMPARE_URL+x}" ] - then - COMMIT_RANGE=$(echo "${CIRCLE_COMPARE_URL}" | cut -d/ -f7) - if [[ $COMMIT_RANGE != *"..."* ]]; then - COMMIT_RANGE="${COMMIT_RANGE}...${COMMIT_RANGE}" - fi - else - COMMIT_RANGE="upstream/master...HEAD" - fi -fi - -git_diff=$( { git diff --diff-filter=d --name-only "${COMMIT_RANGE}" || true ; } \ - | xargs -r file -i | sed -e "s|\(.*\):.*text/x-c.*|\1|g" -e "/:/d") - [[ -z "${git_diff}" ]] || vera++ --error --root "$BUILDSCRIPTS"/vera++ --profile strict <<< "$git_diff" - diff --git a/buildScripts/azure/test.sh b/buildScripts/azure/test.sh deleted file mode 100755 index 2d512eab9e..0000000000 --- a/buildScripts/azure/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -euo pipefail - -[ -r tests_qrs.7z ] || curl -Lo tests_qrs.7z https://dl.trikset.com/edu/.solutions20200701/testing_small.7z -7z -y x tests_qrs.7z -env ASAN_OPTIONS=${ASAN_OPTIONS:-use_sigaltstack=0:fast_unwind_on_malloc=0:detect_leaks=1:detect_stack_use_after_return=1} \ - LSAN_OPTIONS=${LSAN_OPTIONS:-suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0} \ - QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-minimal} \ - TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} \ - PYTHONMALLOC=${PYTHONMALLOC:-malloc} \ - PYTHONIOENCODING=utf-8 \ - python3.${TRIK_PYTHON3_VERSION_MINOR} "$(dirname $(realpath ${BASH_SOURCE[0]}))"/../tests/fieldstest.py bin/$CONFIG/2D-model testing_small diff --git a/buildScripts/azure/vera_translation.sh b/buildScripts/azure/vera_translation.sh deleted file mode 100755 index edb35b198e..0000000000 --- a/buildScripts/azure/vera_translation.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -xuevo pipefail -TRIK_LINTER_OK=true -if which vera++ >/dev/null 2>&1 ; then buildScripts/azure/runVera++.sh || TRIK_LINTER_OK=false ; fi -LUPDATE=lupdate -which lupdate-pro >/dev/null 2>&1 && LUPDATE=lupdate-pro -$LUPDATE studio.pro plugins/robots/editor/*/translations.pro || TRIK_LINTER_OK=false -buildScripts/azure/checkStatus.sh || TRIK_LINTER_OK=false -"$TRIK_LINTER_OK" diff --git a/buildScripts/github/build_internal.sh b/buildScripts/github/build_internal.sh index d712b7fc7f..f7ce9d59ae 100755 --- a/buildScripts/github/build_internal.sh +++ b/buildScripts/github/build_internal.sh @@ -1,18 +1,6 @@ -#!/bin/sh - -#This is a magic fix for macOS, but old Linux /usr/bin/env has no -S option, thus we cannot use shabang line -#An obsolete bash (v3) does not support `exec {varname}<>`, thus we want to use zsh -if ! ( eval 'exec {somevar}<>$(mktemp)' ) ; then - COMPATIBLE_SHELL=/bin/zsh - [ ! -x $COMPATIBLE_SHELL ] && COMPATIBLE_SHELL=/bin/bash || : - exec $COMPATIBLE_SHELL "$0" "$@" -fi - -# enable kinda `bash compatibility` in zsh -if [ -n "$ZSH_VERSION" ] ; then setopt SH_WORD_SPLIT ; fi +#!/bin/bash set -xueo pipefail -exec {lock}<>$(mktemp -t trik-build-lock.XXXX) && trap 'while [ -e /proc/$$/fd/$lock ] && [ $(lsof -t /proc/$$/fd/$lock | wc -l) -ne 3 ] ; do echo "Sleep to wait ..." ; lsof /proc/$$/fd/$lock ; sleep 5 ; done' EXIT export LANG=C ccache -V && ccache -p which g++ diff --git a/buildScripts/travis/after_script.sh b/buildScripts/travis/after_script.sh deleted file mode 100755 index d9c05d2ba3..0000000000 --- a/buildScripts/travis/after_script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -euxo pipefail -$EXECUTOR env CCACHE_CONFIGPATH="$CCACHE_CONFIGPATH" ccache -s - -df -h . - -docker stop builder || : diff --git a/buildScripts/travis/before_install.sh b/buildScripts/travis/before_install.sh deleted file mode 100755 index a06bf8226e..0000000000 --- a/buildScripts/travis/before_install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -euxo pipefail -df -h . -case $TRAVIS_OS_NAME in - osx) -# brew bundle install && brew bundle check --verbose || brew update && brew bundle install && brew bundle check --verbose - ;; - linux) - docker pull trikset/linux-builder - ;; - *) exit 1 ;; -esac diff --git a/buildScripts/travis/build_installer.sh b/buildScripts/travis/build_installer.sh deleted file mode 100755 index ce4fab5b05..0000000000 --- a/buildScripts/travis/build_installer.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -euxo pipefail -QTBIN=${QTBIN:-$($EXECUTOR bash -c "make qmake -n | sed 's#/qmake.*\$##g'")} -case $TRAVIS_OS_NAME in - osx) - QTIFWBIN=$HOME/qtifw/bin - TSNAME=trik-studio-installer-mac-$TRAVIS_BRANCH.dmg - ;; - linux) - QTIFWBIN=/opt/qtifw/bin - #QTIFWBIN=$($EXECUTOR bash -c 'find /Qt/Tools/QtInstallerFramework/ -maxdepth 2 -name bin -type d -print0 | sort -Vrz | head -zn 1') - TSNAME=trik-studio-installer-linux-$TRAVIS_BRANCH.run - ;; - *) exit 1 ;; -esac -df -h . - -if ! $TIMEOUT && [ "$TRAVIS_REPO_SLUG" == "trikset/trik-studio" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] -then -# git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/* -# git fetch --unshallow --tags # for `git describe --tags` to work - #TODO: We can build installer and checker archive in parallel if needed - - if [[ $TRAVIS_OS_NAME == linux ]] ; then - $EXECUTOR bash -ic "\ - echo Start build checker archive \ - && bin/$CONFIG/build-checker-installer.sh \ - && sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' bin/$CONFIG/trik_checker.tar.xz $server:dl/ts/fresh/checker/checker-$TRAVIS_OS_NAME-$CONFIG-$TRAVIS_BRANCH.tar.xz \ - || false \ -" - fi - - $EXECUTOR bash -ic "\ - echo Start build installer \ - && installer/build-trik-studio.sh $QTBIN $QTIFWBIN . \ - && mv installer/trik-studio*installer* installer/$TSNAME \ - && sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' installer/$TSNAME $server:dl/ts/fresh/installer/ \ - || false \ -" -fi diff --git a/buildScripts/travis/checkStatus.sh b/buildScripts/travis/checkStatus.sh deleted file mode 100755 index 4ba37d29e7..0000000000 --- a/buildScripts/travis/checkStatus.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -gitStatus=$(git status -s && git submodule --quiet foreach --recursive git status -s) -if [ ! -z "$gitStatus" ] -then - echo $gitStatus - echo git status must be clean - git diff --minimal - false -else - true -fi - - diff --git a/buildScripts/travis/has_only_skipped_files.sh b/buildScripts/travis/has_only_skipped_files.sh deleted file mode 100755 index b9b94edb9d..0000000000 --- a/buildScripts/travis/has_only_skipped_files.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Returns zero status code only if commit contains only IGNORED_FILES -set -xueo pipefail -IGNORED_FILES='*.md .cirrus.yml appveyor.yml .mergify.yml .github/* buildScripts/docker/*' -COMMIT_FILES=$(git diff --name-only ${TRAVIS_COMMIT_RANGE} || true) -for f in ${COMMIT_FILES:-"_UNDEFINED_FOR_TAGS_"} ; do - ! ( for pattern in $IGNORED_FILES ; do [[ $f != $pattern ]] || exit 1 ; done ) || exit 1 -done diff --git a/buildScripts/travis/install_linux.sh b/buildScripts/travis/install_linux.sh deleted file mode 100755 index 1bec4b8b02..0000000000 --- a/buildScripts/travis/install_linux.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - set -euxo pipefail - docker pull trikset/linux-builder - docker run --cap-add SYS_PTRACE -d -v $HOME:$HOME:rw -w `pwd` --name builder trikset/linux-builder Xvfb :0 diff --git a/buildScripts/travis/install_osx.sh b/buildScripts/travis/install_osx.sh deleted file mode 100755 index 47feb40a24..0000000000 --- a/buildScripts/travis/install_osx.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - set -euo pipefail - export HOMEBREW_NO_INSTALL_CLEANUP=1 - export HOMEBREW_NO_AUTO_UPDATE=1 - brew tap "hudochenkov/sshpass" - TRIK_BREW_PACKAGES="ccache coreutils libusb pkg-config gnu-sed sshpass qt p7zip" - for pkg in $TRIK_BREW_PACKAGES ; do - p="${pkg##*/}" - p="${p%.*}" - brew install "$pkg" || brew upgrade "$pkg" || brew link --force "$pkg" || echo "Failed to install/upgrade $pkg" - done - [ -d $HOME/qtifw ] || env TRIK_QT_INSTALL_DIR="$HOME/qtifw" "$(dirname $(realpath ${BASH_SOURCE[0]}))"/install_qtifw_mac.sh diff --git a/buildScripts/travis/install_qtifw_mac.sh b/buildScripts/travis/install_qtifw_mac.sh deleted file mode 100755 index bf1fde233b..0000000000 --- a/buildScripts/travis/install_qtifw_mac.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -x -TRIK_QT_INSTALL_DIR=${TRIK_QT_INSTALL_DIR:-$HOME/TRIK_QtIfw} -SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) -set -ueo pipefail -D=/tmp/qtifw-installer.dmg -test -r "$D" || curl -L -o "$D" http://download.qt-project.org/official_releases/qt-installer-framework/3.2.2/QtInstallerFramework-mac-x64.dmg -P=$(hdiutil attach "$D" -noverify -noautofsck | grep -o '/Volumes/.*$') -I=$(find "$P" -type f -perm +1 -path '*Contents/MacOS/*' -print | head -n 1 ) -env TRIK_QT_INSTALL_DIR="$TRIK_QT_INSTALL_DIR" "$I" --verbose --no-force-installations --show-virtual-components --script "$SCRIPT_DIR/../../plugins/robots/thirdparty/trikRuntime/trikRuntime/docker/qt_scriptinstall.qs" - -#remove garbage. No way to deselect this in installer script. -rm -rf "$TRIK_QT_INSTALL_DIR"/{doc,examples,Uninstaller.app,Uninstaller.dat} - -du -csh "$TRIK_QT_INSTALL_DIR"/* | sort -h diff --git a/buildScripts/travis/runVera++.sh b/buildScripts/travis/runVera++.sh deleted file mode 100755 index fd6677d943..0000000000 --- a/buildScripts/travis/runVera++.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -xueo pipefail -BUILDSCRIPTS=$(realpath $(dirname $(realpath "${BASH_SOURCE[0]}"))/..) -tclsh "$BUILDSCRIPTS"/vera++/generatePaths.tcl -vera++ --error -p allRules --root "$BUILDSCRIPTS"/vera++ < "$BUILDSCRIPTS"/vera++/params -if [ -z "${COMMIT_RANGE+x}" ] -then - if [ -n "${TRAVIS_COMMIT_RANGE+x}" ] - then - COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}" - elif [ -n "${CIRCLE_COMPARE_URL+x}" ] - then - COMMIT_RANGE=$(echo "${CIRCLE_COMPARE_URL}" | cut -d/ -f7) - if [[ $COMMIT_RANGE != *"..."* ]]; then - COMMIT_RANGE="${COMMIT_RANGE}...${COMMIT_RANGE}" - fi - else - COMMIT_RANGE="upstream/master...HEAD" - fi -fi -git_diff=$( { git diff --diff-filter=d --name-only "${COMMIT_RANGE}" || true ; } \ - | xargs -r file -i | sed -e "s|\(.*\):.*text/x-c.*|\1|g" -e "/:/d") - [[ -z "${git_diff}" ]] || vera++ --error --root "$BUILDSCRIPTS"/vera++ --profile strict <<< "$git_diff" - diff --git a/buildScripts/travis/run_clean_env_test.sh b/buildScripts/travis/run_clean_env_test.sh deleted file mode 100755 index 70442a3419..0000000000 --- a/buildScripts/travis/run_clean_env_test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -curl --output test_qrs.7z "https://dl.trikset.com/edu/.solutions20200701/test.7z" -7z x test_qrs.7z - -case $(uname -s) in - Linux) - curl --output installer.run "https://dl.trikset.com/ts/fresh/installer/trik-studio-installer-linux-master.run" - chmod +x installer.run - ./installer.run --platform minimal --script ./installer/trik_studio_installscript.qs - env QT_QPA_PLATFORM=minimal python3.7 ./buildScripts/tests/fieldstest.py "$HOME/TRIKStudio/bin/2D-model" testing - ;; - Darwin) - env TRIK_STUDIO_INSTALL_DIR="$HOME/TS" ./installer/install_studio_mac.sh - env QT_QPA_PLATFORM=minimal python3.7 ./buildScripts/tests/fieldstest.py "$HOME/TS/TRIK Studio.app/Contents/MacOS/2D-model" testing - ;; - *) exit 1 ;; -esac diff --git a/buildScripts/travis/script.sh b/buildScripts/travis/script.sh deleted file mode 100755 index 3c3349cd82..0000000000 --- a/buildScripts/travis/script.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -set -ueo pipefail - -CODECOV=true -case $TRAVIS_OS_NAME in - osx) - export PATH="/usr/local/opt/qt/bin:$PATH" - export PATH="/usr/local/opt/ccache/libexec:$PATH" - export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" - ;; - linux) - # if [[ "$TESTS" != "true" ]] ; then CODECOV="$EXECUTOR bash -ic \" python -m codecov \" " ; fi - ;; - *) exit 1 ;; -esac - -mkdir -p $CCACHE_DIR || sudo chown -R $USER $CCACHE_DIR || : -cat << EOF > $CCACHE_CONFIGPATH -compiler_check=none -run_second_cpp=true -cache_dir=$CCACHE_DIR -compression=true -compression_level=3 -sloppiness=time_macros,pch_defines,include_file_ctime,include_file_mtime,file_stat_matches -EOF -$EXECUTOR bash -lic " set -xueo pipefail; \ - export CCACHE_CONFIGPATH=$CCACHE_CONFIGPATH \ -&& ccache -p \ -&& which g++ \ -&& g++ --version \ -&& which qmake \ -&& qmake -query \ -&& ccache -sz -M 0 \ -&& pkg-config --list-all \ -&& { which python3 && python3 -V || true ; } \ -&& { which python && python -V || true ; } \ -&& eval 'export PKG_CONFIG_PATH=\`python3.\${TRIK_PYTHON3_VERSION_MINOR}-config --prefix\`/lib/pkgconfig' \ -&& rm -f .qmake.cache \ -&& { echo -n 'Remove broken object files ' ; find . -name '*.o' -type f -print0 | xargs -0 file --mime-type | grep -v 'application/x-object' | cut -f 1 -d ':' | xargs -t rm -f _RM_REQUIRES_ARGUMENTS_BUT_BSD_XARGS_IS_MISSING_R_PARAMETER_ARGUMENT || : ; echo Done ; } \ -&& qmake -Wall PYTHON3_VERSION_MINOR=\$TRIK_PYTHON3_VERSION_MINOR CONFIG+=$CONFIG $QMAKE_EXTRA $PROJECT.pro \ -&& sh -c 'make -j2 qmake_all 1>>build.log 2>&1' \ -&& sh -c 'make -j2 all 1>>build.log 2>&1' \ -&& ls bin/$CONFIG \ -&& { export QT_QPA_PLATFORM=minimal ; \ - export ASAN_OPTIONS=$(if [[ $TRAVIS_OS_NAME == linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:use_sigaltstack=0 ; \ - export LSAN_OPTIONS=suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0 ; \ - export DISPLAY=:0 ; \ - env QT_QPA_PLATFORM=minimal make check -k -s && ( set +eux ; cd bin/$CONFIG && $TESTS ) ; \ - }\ -" - -df -h . -$EXECUTOR bash -ic buildScripts/travis/checkStatus.sh - -$CODECOV diff --git a/buildScripts/travis/test.sh b/buildScripts/travis/test.sh deleted file mode 100755 index 617fb9052a..0000000000 --- a/buildScripts/travis/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -euo pipefail - -[ -r tests_qrs.7z ] || curl -Lo tests_qrs.7z https://dl.trikset.com/edu/.solutions20200701/testing_small.7z -7z -y x tests_qrs.7z -env ASAN_OPTIONS=use_sigaltstack=0 \ - LSAN_OPTIONS=suppressions=$PWD/bin/$CONFIG/lsan.supp:print_suppressions=0 \ - PYTHONIOENCODING=utf-8 \ - QT_QPA_PLATFORM=minimal \ - python3.${TRIK_PYTHON3_VERSION_MINOR} "$(dirname $(realpath ${BASH_SOURCE[0]}))"/../tests/fieldstest.py bin/$CONFIG/2D-model testing_small diff --git a/buildScripts/travis/vera_translation.sh b/buildScripts/travis/vera_translation.sh deleted file mode 100755 index 3b9ae7cf64..0000000000 --- a/buildScripts/travis/vera_translation.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -xuevo pipefail -TRIK_LINTER_OK=true -if which vera++ >/dev/null 2>&1 ; then buildScripts/travis/runVera++.sh || TRIK_LINTER_OK=false ; fi -LUPDATE=lupdate -which lupdate-pro >/dev/null 2>&1 && LUPDATE=lupdate-pro -$LUPDATE studio.pro plugins/robots/editor/*/translations.pro || TRIK_LINTER_OK=false -buildScripts/travis/checkStatus.sh || TRIK_LINTER_OK=false -"$TRIK_LINTER_OK" From 4b3c002ab763606592f4dc1ccee1bfa7ac4486fc Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 25 Jul 2024 15:45:21 +0300 Subject: [PATCH 18/19] Change check translation script --- buildScripts/github/vera_translation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildScripts/github/vera_translation.sh b/buildScripts/github/vera_translation.sh index edb35b198e..d06e5693e8 100755 --- a/buildScripts/github/vera_translation.sh +++ b/buildScripts/github/vera_translation.sh @@ -1,9 +1,9 @@ #!/bin/bash set -xuevo pipefail TRIK_LINTER_OK=true -if which vera++ >/dev/null 2>&1 ; then buildScripts/azure/runVera++.sh || TRIK_LINTER_OK=false ; fi +if which vera++ >/dev/null 2>&1 ; then buildScripts/github/runVera++.sh || TRIK_LINTER_OK=false ; fi LUPDATE=lupdate which lupdate-pro >/dev/null 2>&1 && LUPDATE=lupdate-pro $LUPDATE studio.pro plugins/robots/editor/*/translations.pro || TRIK_LINTER_OK=false -buildScripts/azure/checkStatus.sh || TRIK_LINTER_OK=false +buildScripts/github/checkStatus.sh || TRIK_LINTER_OK=false "$TRIK_LINTER_OK" From 4bb9ce7b96341403321e9b5659e9fa425c7d0605 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 25 Jul 2024 16:44:15 +0300 Subject: [PATCH 19/19] Add dl credentials --- .github/workflows/setup_environment.yml | 5 +- .travis.yml.old | 62 ------------------------- buildScripts/github/build_installer.sh | 9 +++- 3 files changed, 10 insertions(+), 66 deletions(-) delete mode 100644 .travis.yml.old diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 888aea6743..0a8437edbe 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -126,8 +126,9 @@ jobs: TESTS: ${{ inputs.tests }} BRANCH_NAME: ${{ github.event.pull_request.head.ref }} PULLREQUESTNUMBER: ${{ github.event.pull_request.number }} - password: ${{ secrets.password }} - server: ${{ secrets.server }} + ssh_key: ${{ secrets.DL_PRIVATE_SSH_KEY }} + username: ${{ secrets.DL_USERNAME }} + host: ${{ secrets.DL_HOST }} if: ${{ inputs.build_installer == 'true' }} - name: Upload installer artifact diff --git a/.travis.yml.old b/.travis.yml.old deleted file mode 100644 index 65cd88f0fa..0000000000 --- a/.travis.yml.old +++ /dev/null @@ -1,62 +0,0 @@ -sudo: required -dist: trusty - -git: - depth: 1 - -language: cpp -compiler: gcc - -cache: ccache - -env: - - CONFIG=debug PROJECT=qreal VERA=true TESTS=true - - CONFIG=release PROJECT=qreal VERA=false TESTS=true - - CONFIG=debug PROJECT=qrealRobots VERA=false TESTS=true - - CONFIG=release PROJECT=qrealRobots VERA=false TESTS=true - - CONFIG=debug PROJECT=qrealBP VERA=false TESTS=true - - CONFIG=release PROJECT=qrealBP VERA=false TESTS=true - - CONFIG=debug PROJECT=qrealTest VERA=false TESTS="./exampleTests-d && ./qrgui_unittests-d && ./qrrepo_unittests-d && ./qrutils_unittests-d && ./visualDebugSupport_unittests-d && ./qrtext_unittests-d && ./qrgraph_unittests-d && ./generationRulesTool_unittests-d" - - CONFIG=release PROJECT=qrealTest VERA=false TESTS="./exampleTests && ./qrgui_unittests && ./qrrepo_unittests && ./qrutils_unittests && ./visualDebugSupport_unittests && ./qrtext_unittests && ./qrgraph_unittests && ./generationRulesTool_unittests" - - CONFIG=debug PROJECT=qrealRobotsTest VERA=false TESTS="./robots_kitBase_unittests-d && ./robots_interpreterCore_unittests-d && ./robots_twoDModel_unittests-d && ./trik-v62-qts-generator-tests-d && ./robots_utils_unittests-d && ./run-simulator-tests.sh" - -before_install: - - if [ "$TESTS" != "true" ]; then pip install --user codecov; fi - -install: - - if [ "$CXX" = "g++" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi - - if [ "$CXX" = "g++" ]; then sudo apt-get update -qq; fi - - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.9 -y; fi - - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 90; fi - - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90; fi - - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 90; fi - - sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 10C56D0DE9977759 - - sudo add-apt-repository "deb http://ppa.launchpad.net/beineri/opt-qt551-trusty/ubuntu trusty main" - - sudo add-apt-repository ppa:smspillaz/verapp-latest -y - - sudo apt-get update - - sudo apt-get install libboost-system-dev libboost-wave-dev tcl -y - - sudo apt-get install vera++ -y - - sudo apt-get -f install libpango-1.0-0 qt55base qt55svg qt55script qt55multimedia libgl1-mesa-dev libusb-1.0.0-dev -y - - . /opt/qt55/bin/qt55-env.sh - - sudo apt-get install xvfb -y - - Xvfb :0 & - - export DISPLAY=:0 - -script: - - gcc --version - - qmake --version - - if [ "$VERA" = "true" ]; then tclsh buildScripts/vera++/generatePaths.tcl; fi - - if [ "$VERA" = "true" ]; then vera++ --error -p allRules --root buildScripts/vera++ ~/.ssh/id_rsa" +fi + if [[ $RUNNER_OS == Linux ]] ; then echo Start build checker archive $EXECUTOR bash -ic "bin/$CONFIG/build-checker-installer.sh" if $NEED_DEPLOY ; then - $EXECUTOR bash -ic "sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' bin/$CONFIG/trik_checker.tar.xz $server:dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME.tar.xz" + $EXECUTOR bash -ic "rsync -v --rsh="ssh -o StrictHostKeyChecking=no" bin/$CONFIG/trik_checker.tar.xz $username@$host:~/dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME.tar.xz" fi fi + echo Start build installer $EXECUTOR bash -ic "installer/build-trik-studio.sh $QTBIN $QTIFWBIN ." if $NEED_DEPLOY ; then $EXECUTOR bash -ic "\ mv installer/trik-studio*installer* installer/$TSNAME \ - && sshpass -p $password rsync -avze 'ssh -o StrictHostKeyChecking=no' installer/$TSNAME $server:dl/ts/fresh/installer/" + && rsync -v --rsh="ssh -o StrictHostKeyChecking=no" installer/$TSNAME $username@$host:~/dl/ts/fresh/installer/$TSNAME" fi