浏览代码

Merge pull request #5989 from IvanSavenko/better_workflow

Improvements for Github CI workflow
Ivan Savenko 2 月之前
父节点
当前提交
a6df82c616
共有 4 个文件被更改,包括 256 次插入275 次删除
  1. 225 158
      .github/workflows/github.yml
  2. 0 84
      .travis.yml
  3. 13 32
      CI/get_package_name.sh
  4. 18 1
      CMakePresets.json

+ 225 - 158
.github/workflows/github.yml

@@ -9,38 +9,14 @@ on:
   pull_request:
   workflow_dispatch:
 
-env:
-  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
-  BUILD_TYPE: Release
-
 jobs:
   build:
-    needs: extract-version
-    continue-on-error: ${{ matrix.test == 1 }}
+    name: Build (${{ matrix.platform }})
     strategy:
       matrix:
         include:
-          - platform: linux-qt6
-            os: ubuntu-24.04
-            test: 0
-            before_install: linux_qt6.sh
-            preset: linux-clang-test
-
-          - platform: linux-qt5
-            os: ubuntu-24.04
-            test: 1
-            before_install: linux_qt5.sh
-            preset: linux-gcc-test
-
-          - platform: linux-debug
-            os: ubuntu-22.04
-            test: 0
-            before_install: linux_qt5.sh
-            preset: linux-gcc-debug
-
           - platform: mac-intel
             os: macos-13
-            test: 0
             pack: 1
             upload: 1
             pack_type: Release
@@ -54,7 +30,6 @@ jobs:
 
           - platform: mac-arm
             os: macos-13
-            test: 0
             pack: 1
             upload: 1
             pack_type: Release
@@ -68,7 +43,6 @@ jobs:
 
           - platform: ios
             os: macos-13
-            test: 0
             pack: 1
             upload: 1
             pack_type: Release
@@ -81,8 +55,7 @@ jobs:
 
           - platform: msvc-x64
             arch: x64
-            os: windows-latest
-            test: 0
+            os: windows-2025
             pack: 1
             upload: 0
             pack_type: RelWithDebInfo
@@ -93,8 +66,7 @@ jobs:
 
           - platform: msvc-x86
             arch: x86
-            os: windows-latest
-            test: 0
+            os: windows-2025
             pack: 1
             upload: 0
             pack_type: RelWithDebInfo
@@ -106,7 +78,6 @@ jobs:
           - platform: msvc-arm64
             arch: arm64
             os: windows-11-arm
-            test: 0
             pack: 1
             upload: 0
             pack_type: RelWithDebInfo
@@ -117,7 +88,6 @@ jobs:
 
           - platform: mingw_x86_64
             os: ubuntu-24.04
-            test: 0
             pack: 1
             pack_type: Release
             extension: zip
@@ -129,7 +99,6 @@ jobs:
 
           - platform: mingw_x86
             os: ubuntu-24.04
-            test: 0
             pack: 1
             pack_type: Release
             extension: zip
@@ -173,8 +142,6 @@ jobs:
     - name: Prepare CI
       if: "${{ matrix.before_install != '' }}"
       run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
-      env:
-        VCMI_BUILD_PLATFORM: x64
 
     - name: Install Conan Dependencies
       if: "${{ matrix.conan_prebuilts != '' }}"
@@ -186,7 +153,7 @@ jobs:
 
     # ensure the ccache for each PR is separate so they don't interfere with each other
     # fall back to ccache of the vcmi/vcmi repo if no PR-specific ccache is found
-    - name: ccache for PRs
+    - name: Install ccache for PRs
       uses: hendrikmuhs/[email protected]
       if: ${{ github.event.number != '' && !startsWith(matrix.platform, 'msvc') }}
       with:
@@ -194,37 +161,19 @@ jobs:
         restore-keys: |
           ${{ matrix.platform }}-PR-${{ github.event.number }}
           ${{ matrix.platform }}-branch-${{ github.base_ref }}
-        # actual cache takes up less space, at most ~1 GB
         max-size: "5G"
         verbose: 2
 
-    - name: ccache for branch builds
+    - name: Install ccache for branch builds
       uses: hendrikmuhs/[email protected]
       if: ${{ github.event.number == '' && !startsWith(matrix.platform, 'msvc')}}
       with:
         key: ${{ matrix.platform }}-${{ github.ref_name }}
         restore-keys: |
           ${{ matrix.platform }}-branch-${{ github.ref_name }}
-        # actual cache takes up less space, at most ~1 GB
         max-size: "5G"
         verbose: 2
 
-    - name: Prepare Heroes 3 data
-      env:
-        HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }}
-      if: ${{ env.HEROES_3_DATA_PASSWORD != '' && matrix.test == 1 }}
-      run: |
-        if [[ ${{github.repository_owner}} == vcmi ]]
-        then
-            data_url="https://github.com/vcmi-mods/vcmi-test-data/releases/download/v1.0/h3_assets.zip"
-        else
-            data_url="https://github.com/${{github.repository_owner}}/vcmi-test-data/releases/download/v1.0/h3_assets.zip"
-        fi
-        wget --progress=dot:giga "$data_url" -O h3_assets.zip
-        7za x h3_assets.zip -p$HEROES_3_DATA_PASSWORD
-        mkdir -p ~/.local/share/vcmi/
-        mv h3_assets/* ~/.local/share/vcmi/
-
     - name: Install Conan
       if: "${{ matrix.conan_profile != '' }}"
       run: pipx install 'conan<2.0'
@@ -280,13 +229,7 @@ jobs:
 
     - name: Configure
       run: |
-        if [[ ${{matrix.preset}} == linux-gcc-test ]]
-        then
-            cmake -DENABLE_CCACHE:BOOL=ON -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 --preset ${{ matrix.preset }}
-        elif [[ ${{matrix.preset}} == linux-gcc-debug ]]
-        then
-            cmake -DENABLE_CCACHE:BOOL=ON -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 --preset ${{ matrix.preset }}
-        elif [[ (${{matrix.preset}} == android-conan-ninja-release) && (${{github.ref}} != 'refs/heads/master') ]]
+        if [[ (${{matrix.preset}} == android-conan-ninja-release) && (${{github.ref}} != 'refs/heads/master') ]]
         then
             cmake -DENABLE_CCACHE:BOOL=ON -DANDROID_GRADLE_PROPERTIES="applicationIdSuffix=.daily;signingConfig=dailySigning;applicationLabel=VCMI daily;applicationVariant=daily" --preset ${{ matrix.preset }}
         elif ${{startsWith(matrix.platform, 'msvc') }}
@@ -303,13 +246,6 @@ jobs:
         ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
         ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
 
-    - name: Test
-      env:
-        HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }}
-      if: ${{ env.HEROES_3_DATA_PASSWORD != '' && matrix.test == 1 }}
-      run: |
-        ctest --preset ${{matrix.preset}}
-
     - name: Kill XProtect to work around CPack issue on macOS
       if: ${{ startsWith(matrix.platform, 'mac') }}
       run: |
@@ -318,35 +254,6 @@ jobs:
         echo "Waiting..."; counter=0; while pgrep XProtect && ((counter < 20)); do sleep 3; ((counter++)); done
         pgrep XProtect || true
 
-    - name: Ensure Inno Setup is installed
-      if: ${{ startsWith(matrix.platform, 'msvc') }}
-      shell: bash
-      run: |
-        if [ ! -f "/c/Program Files (x86)/Inno Setup 6/ISCC.exe" ] && [ ! -f "/c/ProgramData/Chocolatey/bin/ISCC.exe" ]; then
-          choco install innosetup --no-progress -y
-        fi
-
-    - name: Build VCMI Installer
-      if: ${{ startsWith(matrix.platform, 'msvc') }}
-      run: >
-        CI\wininstaller\build_installer.cmd
-        "${{ needs.extract-version.outputs.short_version }}"
-        "${{ env.VCMI_PACKAGE_BUILD }}"
-        "${{ matrix.arch }}"
-        "VCMI ${{ env.VCMI_PACKAGE_NAME_SUFFIX }}"
-        "${{ env.VCMI_PACKAGE_FILE_NAME }}"
-        "${{ github.workspace }}\out\build\${{ matrix.preset }}\bin\RelWithDebInfo"
-        "${{ github.workspace }}\ucrt"
-      shell: cmd
-
-    - name: Upload VCMI Installer Artifacts
-      if: ${{ startsWith(matrix.platform, 'msvc') }}
-      uses: actions/upload-artifact@v4
-      with:
-        name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - installer
-        path: |
-          ${{ github.workspace }}/CI/wininstaller/Output/*.exe
-
     - name: Pack
       id: cpack
       if: ${{ matrix.pack == 1 }}
@@ -361,44 +268,30 @@ jobs:
         done
         rm -rf _CPack_Packages
 
-    - name: Artifacts
-      if: ${{ matrix.pack == 1 }}
-      uses: actions/upload-artifact@v4
-      with:
-        name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
-        compression-level: 0
-        path: |
-          ${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
-
     - name: Find Android package
       if: ${{ startsWith(matrix.platform, 'android') }}
       run: |
-        builtApkPath="$(ls ${{ github.workspace }}/out/build/${{ matrix.preset }}/android-build/vcmi-app/build/outputs/apk/release/*.${{ matrix.extension }})"
-        builtAabPath="$(ls ${{ github.workspace }}/out/build/${{ matrix.preset }}/android-build/vcmi-app/build/outputs/bundle/release/*.aab)"
-        ANDROID_APK_PATH="${{ github.workspace }}/$VCMI_PACKAGE_FILE_NAME.${{ matrix.extension }}"
-        ANDROID_AAB_PATH="${{ github.workspace }}/$VCMI_PACKAGE_FILE_NAME.aab"
-        mv "$builtApkPath" "$ANDROID_APK_PATH"
-        mv "$builtAabPath" "$ANDROID_AAB_PATH"
-        echo "ANDROID_APK_PATH=$ANDROID_APK_PATH" >> $GITHUB_ENV
-        echo "ANDROID_AAB_PATH=$ANDROID_AAB_PATH" >> $GITHUB_ENV
-
-    - name: Upload Android apk Artifacts
-      if: ${{ startsWith(matrix.platform, 'android') }}
+        OUTPUT_DIRECTORY="${{ github.workspace }}/out/build/${{ matrix.preset }}/android-build/vcmi-app/build/outputs"
+        mv "$OUTPUT_DIRECTORY/apk/release/vcmi-release.apk" "${{ github.workspace }}/$VCMI_PACKAGE_FILE_NAME.apk"
+        mv "$OUTPUT_DIRECTORY/bundle/release/vcmi-release.aab" "${{ github.workspace }}/$VCMI_PACKAGE_FILE_NAME.aab"
+
+    - name: Upload Artifact
+      if: ${{ matrix.pack == 1 }}
       uses: actions/upload-artifact@v4
       with:
         name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
         compression-level: 0
         path: |
-          ${{ env.ANDROID_APK_PATH }}
+          ${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
 
-    - name: Upload Android aab Artifacts
+    - name: Upload AAB Artifact
       if: ${{ startsWith(matrix.platform, 'android') && github.ref == 'refs/heads/master' }}
       uses: actions/upload-artifact@v4
       with:
         name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - aab
         compression-level: 0
         path: |
-          ${{ env.ANDROID_AAB_PATH }}
+          ${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.aab
 
     - name: Upload debug symbols
       if: ${{ startsWith(matrix.platform, 'msvc') }}
@@ -409,9 +302,8 @@ jobs:
         path: |
             ${{github.workspace}}/**/*.pdb
 
-    - name: Upload build
-      if: ${{ (matrix.upload == 1) && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master') }}
-      continue-on-error: true
+    - name: Upload build to download.vcmi.eu
+      if: ${{ matrix.upload == 1 && github.event.number == '' && env.DEPLOY_RSA != '' }}
       run: |
         if [ -z '${{ env.ANDROID_APK_PATH }}' ] ; then
           cd '${{github.workspace}}/out/build/${{matrix.preset}}'
@@ -420,19 +312,10 @@ jobs:
       env:
         DEPLOY_RSA: ${{ secrets.DEPLOY_RSA }}
         PACKAGE_EXTENSION: ${{ matrix.extension }}
-        
-    - name: Upload Installer
-      if: ${{ startsWith(matrix.platform, 'msvc') && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master') }}
-      continue-on-error: true
-      run: |
-        cd '${{github.workspace}}/CI/wininstaller/Output'
-        source '${{github.workspace}}/CI/upload_package.sh'
-      env:
-        DEPLOY_RSA: ${{ secrets.DEPLOY_RSA }}
-        PACKAGE_EXTENSION: exe
 
-  deploy-src:
-    if: always() && github.ref == 'refs/heads/master'
+  upload-source-package:
+    name: Upload Source Code Package
+    if: always() && github.event.number == ''
     runs-on: ubuntu-24.04
     defaults:
       run:
@@ -458,35 +341,219 @@ jobs:
           uses: actions/upload-artifact@v4
           with:
             name: ${{ env.VCMI_PACKAGE_FILE_NAME }}
+            compression-level: 0
             path: |
               ./release.tar.gz
+
+  test:
+    continue-on-error: true
+    name: Test (${{ matrix.platform }})
+    strategy:
+      matrix:
+        include:
+          - platform: gcc-latest-release
+            os: ubuntu-24.04
+            before_install: linux_qt6.sh
+            compiler_cxx: g++-14
+            compiler_cc: gcc-14
+            preset: linux-gcc-test
+
+          - platform: clang-latest-debug
+            os: ubuntu-24.04
+            before_install: linux_qt6.sh
+            compiler_cxx: clang++-18
+            compiler_cc: clang-18
+            preset: linux-clang-debug
+
+          - platform: gcc-oldest-debug
+            os: ubuntu-22.04
+            before_install: linux_qt5.sh
+            compiler_cxx: g++-10
+            compiler_cc: gcc-10
+            preset: linux-gcc-debug
+
+          - platform: clang-oldest-release
+            os: ubuntu-22.04
+            before_install: linux_qt5.sh
+            compiler_cxx: clang++-13
+            compiler_cc: clang-13
+            preset: linux-clang-test
   
-  extract-version:
-    name: Extract Version
-    runs-on: ubuntu-latest
-    outputs:
-      version_timestamp: ${{ steps.extract.outputs.version_timestamp }}
-      short_version: ${{ steps.extract.outputs.short_version }}
+    runs-on: ${{ matrix.os }}
+    defaults:
+      run:
+        shell: bash
+
     steps:
-      - uses: actions/checkout@v4
+    - name: Checkout repository
+      uses: actions/checkout@v4
+      with:
+        submodules: recursive
+
+    - name: Prepare CI
+      run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
+
+    - name: Install ccache for PRs
+      uses: hendrikmuhs/[email protected]
+      if: ${{ github.event.number != '' }}
+      with:
+        key: ${{ matrix.platform }}-PR-${{ github.event.number }}
+        restore-keys: |
+          ${{ matrix.platform }}-PR-${{ github.event.number }}
+          ${{ matrix.platform }}-branch-${{ github.base_ref }}
+        max-size: "5G"
+        verbose: 2
+
+    - name: Install ccache for branch builds
+      uses: hendrikmuhs/[email protected]
+      if: ${{ github.event.number == '' }}
+      with:
+        key: ${{ matrix.platform }}-${{ github.ref_name }}
+        restore-keys: |
+          ${{ matrix.platform }}-branch-${{ github.ref_name }}
+        max-size: "5G"
+        verbose: 2
+
+    - name: Prepare Heroes 3 data
+      env:
+        HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }}
+      if: ${{ env.HEROES_3_DATA_PASSWORD != '' }}
+      run: |
+        if [[ ${{github.repository_owner}} == vcmi ]]
+        then
+            data_url="https://github.com/vcmi-mods/vcmi-test-data/releases/download/v1.0/h3_assets.zip"
+        else
+            data_url="https://github.com/${{github.repository_owner}}/vcmi-test-data/releases/download/v1.0/h3_assets.zip"
+        fi
+        wget --progress=dot:giga "$data_url" -O h3_assets.zip
+        7za x h3_assets.zip -p$HEROES_3_DATA_PASSWORD
+        mkdir -p ~/.local/share/vcmi/
+        mv h3_assets/* ~/.local/share/vcmi/
   
-      - name: Extract version info
-        id: extract
+    - name: Configure
+      run: |
+            cmake -DENABLE_CCACHE:BOOL=ON -DCMAKE_C_COMPILER=${{ matrix.compiler_cc }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler_cxx }} --preset ${{ matrix.preset }}
+
+    - name: Build
+      run: |
+        cmake --build --preset ${{matrix.preset}}
+
+    - name: Test
+      env:
+        HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }}
+      if: ${{ env.HEROES_3_DATA_PASSWORD != '' }}
+      run: |
+        ctest --preset ${{matrix.preset}}
+
+  windows-installer:
+    needs: build
+    name: Create Windows Installer (${{ matrix.arch }})
+    strategy:
+      matrix:
+        include:
+          - platform: msvc-x64
+            arch: x64
+            os: windows-2025
+
+          - platform: msvc-x86
+            arch: x86
+            os: windows-2025
+
+          - platform: msvc-arm64
+            arch: arm64
+            os: windows-11-arm
+
+    runs-on: ${{ matrix.os }}
+    defaults:
+      run:
         shell: bash
-        run: |
-          filePath="${GITHUB_WORKSPACE}/cmake_modules/VersionDefinition.cmake"
-  
-          major=$(grep -oP 'set\(VCMI_VERSION_MAJOR\s+\K\d+' "$filePath")
-          minor=$(grep -oP 'set\(VCMI_VERSION_MINOR\s+\K\d+' "$filePath")
-          patch=$(grep -oP 'set\(VCMI_VERSION_PATCH\s+\K\d+' "$filePath")
-  
-          short_version="${major}.${minor}.${patch}"
-          version_timestamp=$(date +"%Y%m%d%H%M%S")
-  
-          echo "short_version=${short_version}" >> "$GITHUB_OUTPUT"
-          echo "version_timestamp=${version_timestamp}" >> "$GITHUB_OUTPUT"
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v4
+      with:
+        submodules: recursive
+
+    - name: Extract version info
+      id: extract-version
+      shell: bash
+      run: |
+        filePath="${GITHUB_WORKSPACE}/cmake_modules/VersionDefinition.cmake"
+
+        major=$(grep -m 1 "VCMI_VERSION_MAJOR" "$filePath" | tr -d -c 0-9)
+        minor=$(grep -m 1 "VCMI_VERSION_MINOR" "$filePath" | tr -d -c 0-9)
+        patch=$(grep -m 1 "VCMI_VERSION_PATCH" "$filePath" | tr -d -c 0-9)
+
+        short_version="${major}.${minor}.${patch}"
+        version_timestamp=$(date +"%Y%m%d%H%M%S")
+
+        echo "short_version=${short_version}" >> "$GITHUB_OUTPUT"
+        echo "version_timestamp=${version_timestamp}" >> "$GITHUB_OUTPUT"
+
+    - name: Install vcpkg Dependencies
+      run: source '${{github.workspace}}/CI/install_vcpkg_dependencies.sh' '${{matrix.platform}}'
+
+    - name: Build Number
+      run: |
+        source '${{github.workspace}}/CI/get_package_name.sh'
+        VCMI_PACKAGE_FILE_NAME+="-${{ matrix.arch }}"
+        echo VCMI_PACKAGE_FILE_NAME="$VCMI_PACKAGE_FILE_NAME" >> $GITHUB_ENV
+        echo VCMI_PACKAGE_BUILD="$VCMI_PACKAGE_BUILD" >> $GITHUB_ENV
+        echo VCMI_PACKAGE_NAME_SUFFIX="$VCMI_PACKAGE_NAME_SUFFIX" >> $GITHUB_ENV
+        echo VCMI_PACKAGE_GOLDMASTER="$VCMI_PACKAGE_GOLDMASTER" >> $GITHUB_ENV
+      env:
+        PULL_REQUEST: ${{ github.event.pull_request.number }}
+
+    - name: Download Artifact
+      uses: actions/download-artifact@v4
+      with:
+        name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
+        path: ${{github.workspace}}/artifact
+
+    - name: Extract Artifact
+      shell: bash
+      run: |
+        mkdir artifact/extracted
+        unzip "artifact/${{ env.VCMI_PACKAGE_FILE_NAME }}.zip" -d artifact/extracted
+
+    - name: Ensure Inno Setup is installed
+      shell: bash
+      run: |
+        if [ ! -f "/c/Program Files (x86)/Inno Setup 6/ISCC.exe" ] && [ ! -f "/c/ProgramData/Chocolatey/bin/ISCC.exe" ]; then
+          choco install innosetup --no-progress -y
+        fi
+
+    - name: Build VCMI Installer
+      run: >
+        CI\wininstaller\build_installer.cmd
+        "${{ steps.extract-version.outputs.short_version }}"
+        "${{ env.VCMI_PACKAGE_BUILD }}"
+        "${{ matrix.arch }}"
+        "VCMI ${{ env.VCMI_PACKAGE_NAME_SUFFIX }}"
+        "${{ env.VCMI_PACKAGE_FILE_NAME }}"
+        "${{ github.workspace }}\artifact\extracted"
+        "${{ github.workspace }}\ucrt"
+      shell: cmd
+
+    - name: Upload VCMI Installer Artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - installer
+        compression-level: 0
+        path: |
+          ${{ github.workspace }}/CI/wininstaller/Output/*.exe
+
+    - name: Upload Installer
+      if: ${{ github.event.number == '' && env.DEPLOY_RSA != '' }}
+      run: |
+        cd '${{github.workspace}}/CI/wininstaller/Output'
+        source '${{github.workspace}}/CI/upload_package.sh'
+      env:
+        DEPLOY_RSA: ${{ secrets.DEPLOY_RSA }}
+        PACKAGE_EXTENSION: exe
 
   validate-code:
+    name: Validate Code
     if: always()
     runs-on: ubuntu-latest
     defaults:

+ 0 - 84
.travis.yml

@@ -1,84 +0,0 @@
-language: cpp
-os:
-- linux
-- osx
-dist: trusty
-sudo: required
-env:
-  matrix:
-    - ignore=this
-  global:
-  - secure: NMg+qtQB4DIZ/KqlDeIn3K7A7Ydksdpnbv6Ha9n4bSSA0AT8wlPwbHXvQmiR8qYs6cnz4fyY6NVcBe7X3bdR8jWyPNAS0l0QByqG12q3dBpEtNNn0X5u/GS3wHse5+ObNAF9a83+xACTQj2UdxqHgJ3LFGzdBpQt3kLsc8NDnn8=
-
-matrix:
-  exclude:
-  - env: ignore=this
-  include:
-  - os: linux
-    compiler: clang
-    env: VCMI_PLATFORM='linux' REAL_CC=clang-3.6 REAL_CXX=clang++-3.6 PACKAGE=clang-3.6
-      SUPPORT=libstdc++-4.8-dev
-  - os: linux
-    compiler: clang
-    env: VCMI_PLATFORM='linux' REAL_CC=clang-3.4 REAL_CXX=clang++-3.4 PACKAGE=clang-3.4
-      SUPPORT=libstdc++-4.8-dev
-  - os: linux
-    compiler: gcc
-    env: VCMI_PLATFORM='linux' REAL_CC=gcc-4.8   REAL_CXX=g++-4.8     PACKAGE=g++-4.8   SUPPORT=
-  - os: linux
-    env: VCMI_PLATFORM='mxe' MXE_TARGET=i686-w64-mingw32.shared VCMI_CMAKE_FLAGS='-DENABLE_TEST=0'
-    sudo: required
-  - os: osx
-    env: VCMI_PLATFORM='mac' VCMI_CMAKE_FLAGS='-DENABLE_TEST=0'
-
-addons:
-  apt:
-    update: true
-  coverity_scan:
-    project:
-      name: vcmi/vcmi
-      description: Build submitted via Travis CI
-    notification_email: [email protected]
-    build_command_prepend: cov-configure --compiler clang-3.6 --comptype clangcc &&
-      cov-configure --comptype clangcxx --compiler clang++-3.6 && cmake -G Ninja ..
-      -DCMAKE_BUILD_TYPE=DEBUG -DENABLE_LAUNCHER=0 -DENABLE_EDITOR=0
-    build_command: ninja -j 3
-    branch_pattern: coverity_scan
-
-notifications:
-  email:
-    recipients:
-    - [email protected]
-    on_success: change
-    on_failure: always
-
-before_install:
-- test $TRAVIS_BRANCH != coverity_scan -o ${TRAVIS_JOB_NUMBER##*.} = 1 || exit 0
-- . $TRAVIS_BUILD_DIR/CI/$VCMI_PLATFORM/before_install.sh
-
-before_script:
-- mkdir build
-- cd build
-- if [[ $TRAVIS_BRANCH != 'coverity_scan' ]];
-  then
-    source $TRAVIS_BUILD_DIR/CI/get_package_name.sh;
-    if [[ $VCMI_PLATFORM == 'mxe' ]];
-    then
-      /usr/lib/mxe/usr/bin/i686-w64-mingw32.shared-cmake -G Ninja .. $VCMI_CMAKE_FLAGS
-      -DPACKAGE_NAME_SUFFIX:STRING="$VCMI_PACKAGE_NAME_SUFFIX"
-      -DPACKAGE_FILE_NAME:STRING="$VCMI_PACKAGE_FILE_NAME";
-    else
-      cmake -G Ninja .. $VCMI_CMAKE_FLAGS
-      -DPACKAGE_NAME_SUFFIX:STRING="$VCMI_PACKAGE_NAME_SUFFIX"
-      -DPACKAGE_FILE_NAME:STRING="$VCMI_PACKAGE_FILE_NAME";
-    fi
-
-  fi
-  
-script:
-- test $TRAVIS_BRANCH != coverity_scan || exit 0
-- ninja
-
-after_success:
-- test $TRAVIS_BRANCH != coverity_scan || exit 0
-- . $TRAVIS_BUILD_DIR/CI/$VCMI_PLATFORM/upload_package.sh

+ 13 - 32
CI/get_package_name.sh

@@ -1,53 +1,34 @@
 #!/bin/sh
-if [ ! -z "$TRAVIS_JOB_ID" ];
-then
-	echo "Using Travis environment variables!"
-	TMP_JOBID="$TRAVIS_JOB_ID"
-	TMP_BRANCH="$TRAVIS_BRANCH"
-	TMP_PRID="$TRAVIS_PULL_REQUEST"
-	TMP_COMMIT="$TRAVIS_COMMIT"
-elif [ ! -z "${APPVEYOR_JOB_ID}" ];
-then
-	echo "Using AppVeyor environment variables!"
-	TMP_JOBID=$(echo "$APPVEYOR_JOB_ID" | sed 's/[^[:digit:]]\+//g')
-	TMP_BRANCH="$APPVEYOR_REPO_BRANCH"
-	TMP_PRID="$APPVEYOR_PULL_REQUEST_NUMBER"
-	TMP_COMMIT="$APPVEYOR_REPO_COMMIT"
-elif [ ! -z "${GITHUB_RUN_ID}" ];
-then
-	echo "Using Github environment variables!"
-	TMP_JOBID="$GITHUB_RUN_ID"
-	TMP_BRANCH=$(basename ${GITHUB_REF#refs/heads/})
-	TMP_PRID="$PULL_REQUEST"
-	TMP_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
-else
-	echo "No Travir or AppVeyor environment variables found!"
-	exit
-fi
+
+echo "Using Github environment variables!"
+TMP_JOBID="$GITHUB_RUN_ID"
+TMP_BRANCH=$(basename ${GITHUB_REF#refs/heads/})
+TMP_PRID="$PULL_REQUEST"
+TMP_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
 
 VCMI_PACKAGE_FILE_NAME="${TMP_JOBID}-vcmi"
 VCMI_PACKAGE_BUILD="${TMP_COMMIT}"
 VCMI_PACKAGE_NAME_SUFFIX=""
 VCMI_PACKAGE_GOLDMASTER="OFF"
-if [ -z "$TMP_PRID" ] || [ "$TMP_PRID" == "false" ];
+if [ -z "$TMP_PRID" ] || [ "$TMP_PRID" == "false" ]
 then
 	branch_name=$(echo "$TMP_BRANCH" | sed 's/[^[:alnum:]]\+/_/g')
 	VCMI_PACKAGE_FILE_NAME="${VCMI_PACKAGE_FILE_NAME}-branch-${branch_name}-${TMP_COMMIT}"
 	if [ "${branch_name}" != "master" ];
 	then
-		VCMI_PACKAGE_NAME_SUFFIX="branch ${branch_name}"
+		VCMI_PACKAGE_NAME_SUFFIX="(branch ${branch_name})"
 	else
 		VCMI_PACKAGE_GOLDMASTER="ON"
 	fi
 else
 	VCMI_PACKAGE_FILE_NAME="${VCMI_PACKAGE_FILE_NAME}-PR-${TMP_PRID}-${TMP_COMMIT}"
-	VCMI_PACKAGE_NAME_SUFFIX="PR ${TMP_PRID}"
+	VCMI_PACKAGE_NAME_SUFFIX="(PR ${TMP_PRID})"
 fi
 
-if [ "${VCMI_PACKAGE_NAME_SUFFIX}" != "" ];
-then
-	VCMI_PACKAGE_NAME_SUFFIX="(${VCMI_PACKAGE_NAME_SUFFIX})"
-fi
+echo "VCMI_PACKAGE_FILE_NAME=${VCMI_PACKAGE_FILE_NAME}"
+echo "VCMI_PACKAGE_BUILD=${VCMI_PACKAGE_BUILD}"
+echo "VCMI_PACKAGE_NAME_SUFFIX=${VCMI_PACKAGE_NAME_SUFFIX}"
+echo "VCMI_PACKAGE_GOLDMASTER=${VCMI_PACKAGE_GOLDMASTER}"
 
 export VCMI_PACKAGE_FILE_NAME
 export VCMI_PACKAGE_BUILD

+ 18 - 1
CMakePresets.json

@@ -99,7 +99,7 @@
             "name": "linux-gcc-debug",
             "displayName": "GCC x86_64-pc-linux-gnu (debug)",
             "description": "VCMI Linux GCC (Debug)",
-            "inherits": "linux-release",
+            "inherits": "linux-test",
             "cacheVariables": {
                 "CMAKE_BUILD_TYPE": "Debug",
                 "ENABLE_LUA" : "ON",
@@ -107,6 +107,18 @@
                 "CMAKE_CXX_COMPILER": "/usr/bin/g++"
             }
         },
+        {
+            "name": "linux-clang-debug",
+            "displayName": "Clang x86_64-pc-linux-gnu (debug)",
+            "description": "VCMI Linux Clang (Debug)",
+            "inherits": "linux-test",
+            "cacheVariables": {
+                "CMAKE_BUILD_TYPE": "Debug",
+                "ENABLE_LUA" : "ON",
+                "CMAKE_C_COMPILER": "/usr/bin/clang",
+                "CMAKE_CXX_COMPILER": "/usr/bin/clang++"
+            }
+        },
         {
             "name": "linux-clang-test",
             "displayName": "Clang x86_64-pc-linux-gnu with unit testing",
@@ -403,6 +415,11 @@
             "configurePreset": "linux-gcc-debug",
             "inherits": "default-debug"
         },
+        {
+            "name": "linux-clang-debug",
+            "configurePreset": "linux-clang-debug",
+            "inherits": "default-debug"
+        },
         {
             "name": "macos-xcode-release",
             "configurePreset": "macos-xcode-release",