From d55e89e9a33a7206947a83c2717c766360f91dd6 Mon Sep 17 00:00:00 2001 From: MinyazevR <89993880+MinyazevR@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:27:21 +0300 Subject: [PATCH] Switch from azure to github actions * Add macOS-12 CI * Add lint before build * Add warn-off for all macos config, remove trik_nopython * No need for compatibility and azure/travis removal --- .circleci/config.yml | 42 --- .github/workflows/linux_build.yml | 91 ++++++ .github/workflows/macos_build.yml | 96 +++++++ .github/workflows/rockylinux.yml | 8 + .github/workflows/setup_environment.yml | 143 ++++++++++ .travis.yml.old | 62 ----- azure-pipelines.yml | 261 ------------------ buildScripts/appveyor/git.cmd | 1 - buildScripts/azure/build_internal.sh | 41 --- buildScripts/azure/install_Darwin.sh | 20 -- buildScripts/azure/install_Linux.sh | 5 - buildScripts/azure/vera_translation.sh | 9 - buildScripts/{azure => github}/build.sh | 11 +- .../{azure => github}/build_installer.sh | 19 +- buildScripts/github/build_internal.sh | 29 ++ buildScripts/{azure => github}/checkStatus.sh | 2 - buildScripts/github/install_Linux.sh | 5 + buildScripts/github/install_macOS.sh | 20 ++ .../{azure => github}/install_qtifw_mac.sh | 2 +- buildScripts/{azure => github}/runVera++.sh | 1 - buildScripts/{azure => github}/test.sh | 0 .../{travis => github}/vera_translation.sh | 4 +- 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 - 34 files changed, 412 insertions(+), 678 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/linux_build.yml create mode 100644 .github/workflows/macos_build.yml create mode 100644 .github/workflows/setup_environment.yml delete mode 100644 .travis.yml.old delete mode 100644 azure-pipelines.yml delete mode 100644 buildScripts/appveyor/git.cmd delete mode 100755 buildScripts/azure/build_internal.sh delete mode 100755 buildScripts/azure/install_Darwin.sh delete mode 100755 buildScripts/azure/install_Linux.sh delete mode 100755 buildScripts/azure/vera_translation.sh rename buildScripts/{azure => github}/build.sh (77%) rename buildScripts/{azure => github}/build_installer.sh (57%) create mode 100755 buildScripts/github/build_internal.sh rename buildScripts/{azure => github}/checkStatus.sh (99%) create mode 100755 buildScripts/github/install_Linux.sh create mode 100755 buildScripts/github/install_macOS.sh rename buildScripts/{azure => github}/install_qtifw_mac.sh (96%) rename buildScripts/{azure => github}/runVera++.sh (99%) rename buildScripts/{azure => github}/test.sh (100%) rename buildScripts/{travis => github}/vera_translation.sh (68%) 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 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/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml new file mode 100644 index 0000000000..6c9bc8e57c --- /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+=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+=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 + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + 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 + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + config: debug + 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] + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: true + 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 new file mode 100644 index 0000000000..29c847ad7d --- /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+=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+=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: + 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+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + + 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+=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] + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + executor: "time" + build: true + build_installer: true + qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + tests: true 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: diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml new file mode 100644 index 0000000000..0a8437edbe --- /dev/null +++ b/.github/workflows/setup_environment.yml @@ -0,0 +1,143 @@ +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: | + 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_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 }} + ssh_key: ${{ secrets.DL_PRIVATE_SSH_KEY }} + username: ${{ secrets.DL_USERNAME }} + host: ${{ secrets.DL_HOST }} + if: ${{ inputs.build_installer == 'true' }} + + - name: Upload installer artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }}-installer + path: | + installer/*.exe + installer/*.run + installer/*.dmg + if: ${{ inputs.build_installer == 'true' }} + 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++ /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_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/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/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/azure/build.sh b/buildScripts/github/build.sh similarity index 77% rename from buildScripts/azure/build.sh rename to buildScripts/github/build.sh index 711c804655..253a7e2ae3 100755 --- a/buildScripts/azure/build.sh +++ b/buildScripts/github/build.sh @@ -2,8 +2,8 @@ set -uxeo pipefail CODECOV=true -case $AGENT_OS in - Darwin) +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" @@ -11,7 +11,6 @@ case $AGENT_OS in echo "Now path is $PATH" ;; Linux) - # if [[ "$TESTS" != "true" ]] ; then CODECOV="$EXECUTOR bash -ic \" python -m codecov \" " ; fi ;; *) exit 1 ;; esac @@ -29,15 +28,15 @@ EOF $EXECUTOR env \ CCACHE_CONFIGPATH="$CCACHE_CONFIGPATH" \ +CCACHE_DIR="$CCACHE_DIR" \ CONFIG="$CONFIG" \ QMAKE_EXTRA="$QMAKE_EXTRA" \ PROJECT="$PROJECT" \ -AGENT_OS="$AGENT_OS" \ +RUNNER_OS="$RUNNER_OS" \ TESTS="$TESTS" \ -buildScripts/azure/build_internal.sh +buildScripts/github/build_internal.sh df -h . -$EXECUTOR bash -ic buildScripts/azure/checkStatus.sh $CODECOV diff --git a/buildScripts/azure/build_installer.sh b/buildScripts/github/build_installer.sh similarity index 57% rename from buildScripts/azure/build_installer.sh rename to buildScripts/github/build_installer.sh index 27b380dd22..d9926029e3 100755 --- a/buildScripts/azure/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -1,9 +1,9 @@ #!/bin/bash set -euxo pipefail -BRANCH_NAME="${BRANCH_NAME:-$BUILD_SOURCEBRANCHNAME}" +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 $AGENT_OS in - Darwin) +case $RUNNER_OS in + 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')" @@ -17,20 +17,25 @@ case $AGENT_OS in esac df -h . -NEED_DEPLOY=$([[ "$BUILD_REPOSITORY_NAME" == "trikset/trik-studio" && "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false ) +NEED_DEPLOY=$([[ "$GITHUB_REPOSITORY" == "trikset/trik-studio" && "${PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false ) -if [[ $AGENT_OS == Linux ]] ; then +if $NEED_DEPLOY ; then + $EXECUTOR bash -ic "install -m 600 -D /dev/null ~/.ssh/id_rsa && echo $ssh_key > ~/.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 diff --git a/buildScripts/github/build_internal.sh b/buildScripts/github/build_internal.sh new file mode 100755 index 0000000000..f7ce9d59ae --- /dev/null +++ b/buildScripts/github/build_internal.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -xueo pipefail +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 -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 +make -j $(nproc) all 2>&1 | tee -a build.log +ccache -s +ls bin/$CONFIG +export QT_QPA_PLATFORM=minimal +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))')} +export PYTHONMALLOC=malloc +env +make check -k -s && ( set +eux ; cd "bin/$CONFIG" && eval "$TESTS" ) diff --git a/buildScripts/azure/checkStatus.sh b/buildScripts/github/checkStatus.sh similarity index 99% rename from buildScripts/azure/checkStatus.sh rename to buildScripts/github/checkStatus.sh index 4ba37d29e7..22c67a625e 100755 --- a/buildScripts/azure/checkStatus.sh +++ b/buildScripts/github/checkStatus.sh @@ -9,5 +9,3 @@ then 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/azure/install_qtifw_mac.sh b/buildScripts/github/install_qtifw_mac.sh similarity index 96% rename from buildScripts/azure/install_qtifw_mac.sh rename to buildScripts/github/install_qtifw_mac.sh index a540c1a896..44ea1bde64 100755 --- a/buildScripts/azure/install_qtifw_mac.sh +++ b/buildScripts/github/install_qtifw_mac.sh @@ -3,7 +3,7 @@ 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 +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/.*$') diff --git a/buildScripts/azure/runVera++.sh b/buildScripts/github/runVera++.sh similarity index 99% rename from buildScripts/azure/runVera++.sh rename to buildScripts/github/runVera++.sh index ee4f9af891..7ac54396f6 100755 --- a/buildScripts/azure/runVera++.sh +++ b/buildScripts/github/runVera++.sh @@ -24,4 +24,3 @@ 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/github/test.sh similarity index 100% rename from buildScripts/azure/test.sh rename to buildScripts/github/test.sh diff --git a/buildScripts/travis/vera_translation.sh b/buildScripts/github/vera_translation.sh similarity index 68% rename from buildScripts/travis/vera_translation.sh rename to buildScripts/github/vera_translation.sh index 3b9ae7cf64..d06e5693e8 100755 --- a/buildScripts/travis/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/travis/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/travis/checkStatus.sh || TRIK_LINTER_OK=false +buildScripts/github/checkStatus.sh || TRIK_LINTER_OK=false "$TRIK_LINTER_OK" 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