Skip to content

another try

another try #125

Workflow file for this run

name: Build Linux
on:
push:
paths:
- 'vcpkg-test/**'
- 'vcpkg-overlay/**'
- '.github/workflows/linux.yml'
release:
types:
- published
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:
ARCH: 'x64'
UBUNTU_VERSION: 2204
QT_VERSION: '6.5.2'
CACHE_VERSION: 0
VCPKG_BASELINE: "2f6176ce98fee807a207dc9e8fec213f111c291b" # use scripts/update_vcpkg_base.bash to change
VCPKG_ROOT: "/home/runner/vcpkg-root" # Looks like there is more space on C: than on D: drive (~14GB)
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest # cmake & ninja
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
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 cached vcpkg build folder
id: cache-vcpkg-restore
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }}
- name: Clone vcpkg
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
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
- name: Build SDK ${{ env.ARCH }}-linux
run: |
mkdir -p ${{ github.workspace }}/build/${{ env.ARCH }}
cd ${{ github.workspace }}/build/${{ env.ARCH }}
cmake -B ${{ github.workspace }}/build/${{ env.ARCH }} \
-S ${{ github.workspace }}/vcpkg-test \
-DCMAKE_MODULE_PATH:PATH="${{ github.workspace }}/vcpkg-test/cmake" \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
-G Ninja \
-DVCPKG_TARGET_TRIPLET=${{ env.ARCH }}-linux \
-DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \
-DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports"
- name: Upload build logs on deps failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: build-logs-${{ env.ARCH }}-linux
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Save cached vcpkg build folder
uses: actions/cache/save@v3
if: always()
id: cache-vcpkg-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ runner.os }}-vcpkg-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }}
- name: Build Test App
run: |
cd ${{ github.workspace }}/build/${{ env.ARCH }}
ninja
- name: Run Tests
run: |
cd ${{ github.workspace }}/build/${{ env.ARCH }}
ls -la
- name: Get TimeStamp
id: time
uses: nanzm/get-time-action@v1.1
with:
timeZone: 8
format: 'YYYYMMDD'
- name: Create package
run: |
SDK_TAR=input-sdk-ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV
cd "${{ github.workspace }}/build/stage/${{ env.ARCH }}"
tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./
- name: Upload Sdk in Artifacts
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/${{ env.SDK_TAR }}
- name: Create Release
if: ${{ github.ref == 'refs/heads/master' }}
uses: ncipollo/release-action@v1
with:
tag: ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.time.outputs.time }}-${{ github.run_number }}
allowUpdates: true
artifacts: ${{ env.SDK_TAR }}
token: ${{ secrets.GITHUB_TOKEN }}