try #130
Workflow file for this run
This file contains 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: Build Linux | |
on: | |
push: | |
paths-ignore: | |
- '.github/workflows/android.yml' | |
- '.github/workflows/ios.yml' | |
- '.github/workflows/mac.yml' | |
- '.github/workflows/win.yml' | |
- 'LICENSE' | |
- 'README.md' | |
concurrency: | |
group: ci-${{github.ref}}-linux | |
cancel-in-progress: true | |
jobs: | |
linux_build: | |
runs-on: ubuntu-22.04 | |
if: github.repository == 'merginmaps/input-sdk' | |
env: | |
QT_VERSION: '6.5.2' | |
TRIPLET: "x64-linux" | |
QT_ARCH: "desktop" | |
VCPKG_ROOT: "${{ github.workspace }}/vcpkg" | |
VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change | |
CACHE_VERSION: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: input-sdk | |
- name: Prepare vars | |
id: vars | |
run: | | |
sudo apt-get install -y \ | |
bison flex \ | |
cmake ninja-build | |
echo "VCPKG_ROOT: ${{ env.VCPKG_ROOT }}" | |
- uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ env.QT_VERSION }} | |
target: ${{ env.QT_ARCH }} | |
setup-python: 'false' | |
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools' | |
dir: ${{ github.workspace }} | |
cache: true | |
cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-lnx | |
- name: Restore vcpkg folder | |
id: cache-vcpkg-restore | |
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ env.VCPKG_ROOT }} | |
key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }} | |
- name: Get vcpkg | |
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true' | |
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 | |
git checkout $VCPKG_BASELINE | |
./bootstrap-vcpkg.sh | |
- name: Build Deps | |
run: | | |
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV | |
which vcpkg | |
mkdir -p ${{ github.workspace }}/build | |
cd ${{ github.workspace }}/build | |
cmake -B ${{ github.workspace }}/build \ | |
-S ${{ github.workspace }}/input-sdk \ | |
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \ | |
-G Ninja \ | |
-DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ | |
-DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \ | |
-DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports"\ | |
-DCMAKE_MAKE_PROGRAM=ninja | |
- name: Upload build logs on deps failure | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: build-logs-${{ env.TRIPLET }} | |
path: | | |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log | |
- name: Save vcpkg folder | |
uses: actions/cache/save@v3 | |
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too | |
id: cache-vcpkg-save | |
with: | |
path: ${{ env.VCPKG_ROOT }} | |
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} | |
- name: Build Test App | |
run: | | |
cd ${{ github.workspace }}/build | |
ninja | |
- name: Run Tests | |
run: | | |
cd ${{ github.workspace }}/build | |
./merginmapsinputsdk | |
- name: Get TimeStamp | |
id: time | |
uses: nanzm/get-time-action@v1.1 | |
with: | |
timeZone: 8 | |
format: 'YYYYMMDD' | |
- name: Create SDK data folder | |
run: | | |
mkdir -p ${{ github.workspace }}/sdk | |
cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/* | |
rm -rf ${{ github.workspace }}/sdk/debug | |
rm -rf ${{ github.workspace }}/sdk/etc | |
rm -rf ${{ github.workspace }}/sdk/mkspecs | |
rm -rf ${{ github.workspace }}/sdk/share | |
rm -rf ${{ github.workspace }}/sdk/tools | |
SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz | |
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV | |
cd ${{ github.workspace }}/sdk/ | |
find libs/ | |
tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./ | |
- name: Upload Sdk in Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ github.workspace }}/${{ env.SDK_TAR }} | |
- name: Create Release | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }} | |
allowUpdates: true | |
artifacts: ${{ env.SDK_TAR }} | |
token: ${{ secrets.GITHUB_TOKEN }} |