Fix autosync for related features #6182
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: linux Build | |
| on: | |
| push: | |
| paths: | |
| - 'vcpkg/**' | |
| - 'vcpkg.json' | |
| - 'VCPKG_BASELINE' | |
| - 'app/**' | |
| - 'core/**' | |
| - 'scripts/**' | |
| - 'cmake/**' | |
| - 'cmake_templates/**' | |
| - 'test/**' | |
| - 'CMakeLists.txt' | |
| - '.github/workflows/linux.yml' | |
| release: | |
| types: | |
| - published | |
| env: | |
| CMAKE_VERSION: '3.31.6' | |
| VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
| VCPKG_ROOT: "${{ github.workspace }}/vcpkg" | |
| TRIPLET: x64-linux | |
| concurrency: | |
| group: ci-${{github.ref}}-linux | |
| cancel-in-progress: true | |
| jobs: | |
| linux_build: | |
| if: ( github.repository == 'MerginMaps/mobile' ) && (!contains(github.event.head_commit.message, 'Translate ')) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: mm | |
| - name: Free Disk Space | |
| uses: jlumbroso/free-disk-space@main | |
| - name: Install Build Dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y \ | |
| gperf autopoint '^libxcb.*-dev' libx11-xcb-dev libegl1-mesa libegl1-mesa-dev \ | |
| libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev \ | |
| autoconf-archive libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libfuse2 \ | |
| bison flex lcov nasm libxrandr-dev xvfb | |
| # Required to run unit tests on linux | |
| echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: ${{ env.CMAKE_VERSION }} | |
| - name: Extract Mergin API_KEY | |
| env: | |
| MERGINSECRETS_DECRYPT_KEY: ${{ secrets.MERGINSECRETS_DECRYPT_KEY }} | |
| run: | | |
| cd mm/core/ | |
| openssl \ | |
| aes-256-cbc -d \ | |
| -in merginsecrets.cpp.enc \ | |
| -out merginsecrets.cpp \ | |
| -k "$MERGINSECRETS_DECRYPT_KEY" \ | |
| -md md5 | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ccache-${{ env.TRIPLET }} | |
| max-size: 200M | |
| - name: Install vcpkg | |
| shell: bash | |
| run: | | |
| mkdir -p "${{ env.VCPKG_ROOT }}" | |
| cd "${{ env.VCPKG_ROOT }}" | |
| git init | |
| git remote add origin https://github.com/microsoft/vcpkg.git | |
| git pull origin master | |
| VCPKG_TAG=`cat ${{ github.workspace }}/mm/VCPKG_BASELINE` | |
| git checkout ${VCPKG_TAG} | |
| cd "${{ env.VCPKG_ROOT }}" | |
| chmod +x ./bootstrap-vcpkg.sh | |
| ./bootstrap-vcpkg.sh | |
| - name: Setup NuGet Credentials | |
| shell: bash | |
| run: | | |
| mono `${{ env.VCPKG_ROOT }}/vcpkg fetch nuget | tail -n 1` \ | |
| sources add \ | |
| -source "https://nuget.pkg.github.com/merginmaps/index.json" \ | |
| -storepasswordincleartext \ | |
| -name "GitHub" \ | |
| -username "mergin-maps-bot" \ | |
| -password "${{ secrets.MERGIN_MAPS_BOT_GITHUB_TOKEN }}" | |
| mono `${{ env.VCPKG_ROOT }}/vcpkg fetch nuget | tail -n 1` \ | |
| setapikey "${{ secrets.MERGIN_MAPS_BOT_GITHUB_TOKEN }}" \ | |
| -source "https://nuget.pkg.github.com/merginmaps/index.json" | |
| - name: Calculate build number | |
| run: | | |
| BUILD_NUM=$GITHUB_RUN_NUMBER$GITHUB_RUN_ATTEMPT | |
| echo "MM_VERSION_CODE=${BUILD_NUM}" >> $GITHUB_ENV | |
| echo "Version code: ${BUILD_NUM}" | |
| - name: build app (debug) | |
| run: | | |
| mkdir -p build-mm-db | |
| cd build-mm-db | |
| cmake \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ | |
| -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake \ | |
| -DUSE_KEYCHAIN=No \ | |
| -DUSE_MM_SERVER_API_KEY=TRUE \ | |
| -DCOVERAGE=TRUE \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -DENABLE_TESTS=TRUE \ | |
| -GNinja \ | |
| -S ../mm | |
| ninja | |
| - name: run tests | |
| env: | |
| QT_QPA_PLATFORM: "offscreen" | |
| run: | | |
| cd build-mm-db/ | |
| xvfb-run --server-args="-screen 0 640x480x24" ctest --output-on-failure | |
| - name: build lcov summary | |
| run: | | |
| cd build-mm-db | |
| lcov --directory . --capture --output-file coverage.info | |
| lcov --remove coverage.info '*/vcpkg_installed/*' '*Qt/*' '*/merginsecrets.cpp' '*/test/*' '/usr/*' '/Applications/*' '/opt/*' '*build-mm-db/*' --output-file coverage.info | |
| lcov --list coverage.info | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path-to-lcov: build-mm-db/coverage.info | |
| - name: build app | |
| run: | | |
| mkdir -p install-mm | |
| mkdir -p build-mm | |
| cd build-mm | |
| cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ | |
| -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake \ | |
| -DCMAKE_INSTALL_PREFIX:PATH=../install-mm \ | |
| -DUSE_MM_SERVER_API_KEY=TRUE \ | |
| -DUSE_KEYCHAIN=No \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -GNinja \ | |
| -S ../mm | |
| ninja | |
| ninja install | |
| - name: Get TimeStamp | |
| id: time | |
| uses: josStorer/get-current-time@v2.0.2 | |
| with: | |
| format: 'YYYYMMDD' | |
| - name: package app | |
| run: | | |
| MM_TAR=input-${{ env.MM_VERSION_CODE }}-${{ steps.time.outputs.formattedTime }}-${{ github.run_number }}.tar.gz | |
| echo "MM_TAR=${MM_TAR}" >> $GITHUB_ENV | |
| cd ${{ github.workspace }}/install-mm | |
| find . | |
| tar -c -z -f ${{ github.workspace }}/${MM_TAR} ./ | |
| - name: Upload Sdk in Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/${{ env.MM_TAR }} | |
| name: Mergin Maps ${{ env.MM_VERSION_CODE }} x86_64 |