mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:40:06 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			255 lines
		
	
	
	
		
			8.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			255 lines
		
	
	
	
		
			8.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: CI
 | |
| 
 | |
| on:
 | |
|   workflow_dispatch:
 | |
|   push:
 | |
|     branches:
 | |
|       - 'develop'
 | |
|   pull_request:
 | |
|     branches:
 | |
|       - 'develop'
 | |
| 
 | |
| concurrency:
 | |
|   # Cancel in-progress jobs for the same pull request
 | |
|   group: ${{ github.head_ref || github.run_id }}
 | |
|   cancel-in-progress: true
 | |
| 
 | |
| jobs:
 | |
|   build:
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         include:
 | |
|           - name: win64_msvc2022
 | |
|             os: windows-2022
 | |
|             build_type: Release
 | |
|             env_cc: ''
 | |
|             env_cxx: ''
 | |
|             compiler: msvc
 | |
|             msvc_arch: x64
 | |
|             msvc_version: 2022
 | |
|             qt_version: 6.6.2
 | |
|             qt_arch: win64_msvc2019_64
 | |
|             qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport
 | |
|             qt_tools: ''
 | |
|             conan_arch: x86_64
 | |
|             conan_compiler: Visual Studio
 | |
|             conan_compiler_version: 17
 | |
|             conan_compiler_runtime: --settings compiler.runtime=MD
 | |
|             conan_package_manager: ''
 | |
|             artifact_suffix: windows-x64
 | |
|           - name: linux64_gcc
 | |
|             os: ubuntu-22.04
 | |
|             build_type: Release
 | |
|             env_cc: gcc-11
 | |
|             env_cxx: g++-11
 | |
|             compiler: gcc
 | |
|             qt_version: 6.6.2
 | |
|             qt_arch: gcc_64
 | |
|             qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport
 | |
|             qt_tools: ''
 | |
|             conan_arch: x86_64
 | |
|             conan_compiler: gcc
 | |
|             conan_compiler_version: 11
 | |
|             conan_compiler_runtime: ''
 | |
|             conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True
 | |
|             artifact_suffix: linux-x64
 | |
|     name: ${{ matrix.name }}
 | |
|     env:
 | |
|       CC: ${{ matrix.env_cc }}
 | |
|       CXX: ${{ matrix.env_cxx }}
 | |
|       SCWX_VERSION: v0.4.4
 | |
|     runs-on: ${{ matrix.os }}
 | |
| 
 | |
|     steps:
 | |
|     - name: Setup
 | |
|       run: git config --global core.longpaths true
 | |
|       
 | |
|     - name: Checkout
 | |
|       uses: actions/checkout@v4
 | |
|       with:
 | |
|         path: source
 | |
|         submodules: recursive
 | |
| 
 | |
|     - name: Install Qt
 | |
|       uses: jurplel/install-qt-action@v3
 | |
|       with:
 | |
|         version: ${{ matrix.qt_version }}
 | |
|         arch: ${{ matrix.qt_arch }}
 | |
|         modules: ${{ matrix.qt_modules }}
 | |
|         tools: ${{ matrix.qt_tools }}
 | |
| 
 | |
|     - name: Setup MSVC
 | |
|       if: matrix.compiler == 'msvc'
 | |
|       uses: ilammy/msvc-dev-cmd@v1
 | |
|       with:
 | |
|         arch: ${{ matrix.msvc_arch }}
 | |
|         vsversion: ${{ matrix.msvc_version }}
 | |
| 
 | |
|     - name: Setup Ubuntu Environment
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       shell: bash
 | |
|       run: |
 | |
|         sudo apt-get install doxygen \
 | |
|                              libfuse2 \
 | |
|                              ninja-build
 | |
| 
 | |
|     - name: Setup Python Environment
 | |
|       shell: pwsh
 | |
|       run: |
 | |
|         pip install geopandas `
 | |
|                     GitPython
 | |
| 
 | |
|     - name: Install Conan Packages
 | |
|       shell: pwsh
 | |
|       run: |
 | |
|         pip install "conan<2.0"
 | |
|         conan profile new default --detect
 | |
|         conan install ./source/ `
 | |
|           --remote conancenter `
 | |
|           --build missing `
 | |
|           --settings arch=${{ matrix.conan_arch }} `
 | |
|           --settings build_type=${{ matrix.build_type }} `
 | |
|           --settings compiler="${{ matrix.conan_compiler }}" `
 | |
|           --settings compiler.version=${{ matrix.conan_compiler_version }} `
 | |
|           ${{ matrix.conan_compiler_runtime }} `
 | |
|           ${{ matrix.conan_package_manager }}
 | |
| 
 | |
|     - name: Build Supercell Wx
 | |
|       shell: pwsh
 | |
|       run: |
 | |
|         mkdir build
 | |
|         cd build
 | |
|         cmake ../source/ `
 | |
|           -G Ninja `
 | |
|           -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" `
 | |
|           -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx"
 | |
|         ninja supercell-wx wxtest
 | |
| 
 | |
|     - name: Separate Debug Symbols (Linux)
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       shell: bash
 | |
|       run: |
 | |
|         cd build/
 | |
|         cd bin/
 | |
|         objcopy --only-keep-debug supercell-wx supercell-wx.debug
 | |
|         objcopy --strip-debug --strip-unneeded supercell-wx
 | |
|         cd ..
 | |
|         cd lib/
 | |
|         objcopy --only-keep-debug libQMapLibre.so libQMapLibre.so.debug
 | |
|         objcopy --strip-debug --strip-unneeded libQMapLibre.so
 | |
| 
 | |
|     - name: Install Supercell Wx
 | |
|       shell: pwsh
 | |
|       run: |
 | |
|         cd build
 | |
|         cmake --install . --component supercell-wx
 | |
| 
 | |
|     - name: Collect Artifacts
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       shell: bash
 | |
|       run: |
 | |
|         pushd supercell-wx/
 | |
|         cd lib/
 | |
|         ln -s libssl.so.3 libssl.so
 | |
|         rm -f libGLX.so*
 | |
|         rm -f libOpenGL.so*
 | |
|         cd ..
 | |
|         mkdir -p plugins/
 | |
|         cd plugins/
 | |
|         mkdir -p platformthemes/
 | |
|         mkdir -p sqldrivers/
 | |
|         cp "${RUNNER_WORKSPACE}/Qt/${{ matrix.qt_version }}/${{ matrix.qt_arch }}/plugins/platformthemes/libqgtk3.so" platformthemes/
 | |
|         cp "${RUNNER_WORKSPACE}/Qt/${{ matrix.qt_version }}/${{ matrix.qt_arch }}/plugins/sqldrivers/libqsqlite.so" sqldrivers/
 | |
|         cd ..
 | |
|         popd
 | |
|         tar -czf supercell-wx-${{ matrix.artifact_suffix }}.tar.gz supercell-wx/
 | |
| 
 | |
|     - name: Upload Artifacts (Windows)
 | |
|       if: matrix.os == 'windows-2022'
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-${{ matrix.artifact_suffix }}
 | |
|         path: ${{ github.workspace }}/supercell-wx/
 | |
| 
 | |
|     - name: Upload Debug Artifacts (Windows)
 | |
|       if: matrix.os == 'windows-2022'
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-debug-${{ matrix.artifact_suffix }}
 | |
|         path: ${{ github.workspace }}/build/bin/*.pdb
 | |
| 
 | |
|     - name: Upload Artifacts (Linux)
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-${{ matrix.artifact_suffix }}
 | |
|         path: ${{ github.workspace }}/supercell-wx-${{ matrix.artifact_suffix }}.tar.gz
 | |
| 
 | |
|     - name: Upload Debug Artifacts (Linux)
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-debug-${{ matrix.artifact_suffix }}
 | |
|         path: |
 | |
|           ${{ github.workspace }}/build/bin/*.debug
 | |
|           ${{ github.workspace }}/build/lib/*.debug
 | |
| 
 | |
|     - name: Build Installer (Windows)
 | |
|       if: matrix.os == 'windows-2022'
 | |
|       shell: pwsh
 | |
|       run: |
 | |
|         cd build
 | |
|         cpack
 | |
| 
 | |
|     - name: Upload Installer (Windows)
 | |
|       if: matrix.os == 'windows-2022'
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-installer-${{ matrix.artifact_suffix }}
 | |
|         path: ${{ github.workspace }}/build/supercell-wx-*.msi*
 | |
| 
 | |
|     - name: Build AppImage (Linux)
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       env:
 | |
|         APPIMAGE_DIR: ${{ github.workspace }}/supercell-wx/
 | |
|         LDAI_UPDATE_INFORMATION: gh-releases-zsync|dpaulat|supercell-wx|latest|*x86_64.AppImage.zsync
 | |
|         LDAI_OUTPUT: supercell-wx-${{ env.SCWX_VERSION }}-x86_64.AppImage
 | |
|         LINUXDEPLOY_OUTPUT_APP_NAME: supercell-wx
 | |
|         LINUXDEPLOY_OUTPUT_VERSION: ${{ env.SCWX_VERSION }}
 | |
|       shell: bash
 | |
|       run: |
 | |
|         wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
 | |
|         chmod +x linuxdeploy-x86_64.AppImage
 | |
|         cp "${{ github.workspace }}/source/scwx-qt/res/icons/scwx-256.png" supercell-wx.png
 | |
|         cp "${{ github.workspace }}/source/scwx-qt/res/linux/supercell-wx.desktop" .
 | |
|         pushd "${{ env.APPIMAGE_DIR }}"
 | |
|         mkdir -p usr/
 | |
|         mv bin/ usr/
 | |
|         mv lib/ usr/
 | |
|         mv plugins/ usr/
 | |
|         popd
 | |
|         ./linuxdeploy-x86_64.AppImage --appdir ${{ env.APPIMAGE_DIR }} -i supercell-wx.png -d supercell-wx.desktop
 | |
|         ./linuxdeploy-x86_64.AppImage --appdir ${{ env.APPIMAGE_DIR }} --output appimage
 | |
|         rm -f linuxdeploy-x86_64.AppImage
 | |
| 
 | |
|     - name: Upload AppImage (Linux)
 | |
|       if: matrix.os == 'ubuntu-22.04'
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-appimage-x64
 | |
|         path: ${{ github.workspace }}/*-x86_64.AppImage*
 | |
| 
 | |
|     - name: Test Supercell Wx
 | |
|       working-directory: ${{ github.workspace }}/build
 | |
|       env:
 | |
|         MAPBOX_API_KEY:   ${{ secrets.MAPBOX_API_KEY }}
 | |
|         MAPTILER_API_KEY: ${{ secrets.MAPTILER_API_KEY }}
 | |
|       run: ctest -C ${{ matrix.build_type }} --exclude-regex test_mln.*
 | |
| 
 | |
|     - name: Upload Test Logs
 | |
|       if: ${{ !cancelled() }}
 | |
|       uses: actions/upload-artifact@v4
 | |
|       with:
 | |
|         name: supercell-wx-test-logs-${{ matrix.name }}
 | |
|         path: ${{ github.workspace }}/build/Testing/
 | 
