Skip to content

Commit

Permalink
next try:
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Aug 3, 2023
1 parent 2fabc04 commit ad77091
Show file tree
Hide file tree
Showing 39 changed files with 1,010 additions and 1,068 deletions.
126 changes: 78 additions & 48 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,12 @@ jobs:
- uses: actions/checkout@v3
with:
path: 'input-sdk'

- uses: actions/checkout@v3
with:
repository: microsoft/vcpkg
ref: ${{ env.VCPKG_BASELINE }}
path: 'vcpkg'


- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XC_VERSION }}

- uses: lukka/get-cmake@latest
- uses: actions/checkout@v3

- uses: jurplel/install-qt-action@v3
with:
Expand All @@ -53,44 +47,64 @@ jobs:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v1-${{ env.QT_VERSION }}-mac

- name: Prepare build env
run: |
brew install automake bison flex gnu-sed autoconf-archive libtool
echo $(brew --prefix bison)/bin >> $GITHUB_PATH
echo $(brew --prefix flex)/bin >> $GITHUB_PATH
- name: Restore build folder
id: cache-build-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/build
key: ${{ runner.os }}-build-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }}
key: ${{ runner.os }}-build-VCPKG-${{ env.VCPKG_BASELINE }}-CACHE-v${{ env.CACHE_VERSION }}-QT-${{ env.QT_VERSION }}-${{ env.ARCH }}-gitref-${{ github.ref }}

- name: Build SDK ${{ env.ARCH }}-osx
run: |
mkdir -p ${{ github.workspace }}/build/vcpkg
cd ${{ github.workspace }}/build/vcpkg
if [ "$(ls -A .)" ]; then
echo "vcpkg installed - skip download"
else
git init .
git remote add origin https://github.com/microsoft/vcpkg.git
git pull origin master
git checkout $VCPKG_BASELINE
./bootstrap-vcpkg.sh
fi
echo "PATH=${{ github.workspace }}/build/vcpkg:$PATH" >> $GITHUB_ENV
which vcpkg
mkdir -p ${{ github.workspace }}/build/${{ env.ARCH }}
cd ${{ github.workspace }}/build/${{ env.ARCH }}
cmake -B ${{ github.workspace }}/build/${{ env.ARCH }} \
-S ${{ github.workspace }}/input-sdk/vcpkg-test \
-DCMAKE_MODULE_PATH:PATH="${{ github.workspace }}/vcpkg-test/cmake" \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ github.workspace }}/build/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-G Ninja \
-DVCPKG_TARGET_TRIPLET=${{ env.ARCH }}-osx \
-DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/vcpkg-overlay/triplets" \
-DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/vcpkg-overlay/ports" \
-DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=${{ github.workspace }}/build/vcpkg"
-DCMAKE_BUILD_TYPE=Release
- name: Upload build logs on deps failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: build-logs-${{ env.ARCH }}-osx
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
${{ github.workspace }}/build/vcpkg/buildtrees/**/*.log
- name: Save build folder
uses: actions/cache/save@v3
if: always()
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too
id: cache-build-save
with:
path: ${{ github.workspace }}/build
key: ${{ runner.os }}-build-v${{ env.CACHE_VERSION }}-qt-${{ env.QT_VERSION }}-${{ env.ARCH }}
key: ${{ steps.cache-build-restore.outputs.cache-primary-key }}

- name: Build Test App
run: |
Expand All @@ -99,12 +113,8 @@ jobs:
- name: Run Tests
run: |
cd ${{ github.workspace }}/build/${{ env.ARCH }}
ls -la
- name: Create GDAL supported formats
run: |
echo "TODO"
cd ${{ github.workspace }}/build/${{ env.ARCH }}
./merginmapsinputsdk
- name: Get TimeStamp
id: time
Expand All @@ -113,46 +123,66 @@ jobs:
timeZone: 8
format: 'YYYYMMDD'

- name: Create package
- name: Create GDAL supported formats
run: |
echo "Preparing SDK_TAR"
SDK_TAR=input-sdk-qt-${{ env.QT_VERSION }}-mac-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV
cd "${{ github.workspace }}/build/stage/mac"
tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./
echo "Preparing SUPPORTED_FORMATS"
SUPPORTED_FORMATS="input-sdk-gdal-supported-formats-${{ steps.time.outputs.time }}-${{ github.run_number }}.log"
cp ${{ github.workspace }}/build/stage/mac/supported_formats.log ${{ github.workspace }}/$SUPPORTED_FORMATS
echo "SUPPORTED_FORMATS=${SUPPORTED_FORMATS}" >> $GITHUB_ENV
echo "Preparing PROJ_TAR"
PROJ_TAR=input-sdk-proj-mac-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz
echo "PROJ_TAR=${PROJ_TAR}" >> $GITHUB_ENV
echo ".. 1/2 qgis database"
mkdir -p ${{ github.workspace }}/proj-data/resources
cp ${{ github.workspace }}/build/stage/mac/QGIS.app/Contents/Resources/resources/qgis.db ${{ github.workspace }}/proj-data/resources/
cp ${{ github.workspace }}/build/stage/mac/QGIS.app/Contents/Resources/resources/srs.db ${{ github.workspace }}/proj-data/resources/
echo ".. 2/2 proj resources"
mkdir -p ${{ github.workspace }}/proj-data/proj
cp ${{ github.workspace }}/build/stage/mac/share/proj/* ${{ github.workspace }}/proj-data/proj/
cd "${{ github.workspace }}/proj-data"
tar -c -z -f ${{ github.workspace }}/${PROJ_TAR} ./
${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/tools/gdal/gdalinfo --formats | tee -a ${{ github.workspace }}/supported_formats.log
${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/tools/gdal/ogrinfo --formats | tee -a ${{ github.workspace }}/supported_formats.log
SUPPORTED_FORMATS="input-sdk-gdal-supported-formats-${{ steps.time.outputs.time }}-${{ github.run_number }}.log"
echo "SUPPORTED_FORMATS=${SUPPORTED_FORMATS}" >> $GITHUB_ENV
cat ${{ github.workspace }}/supported_formats.log
- name: Create PROJ data folder
run: |
mkdir -p ${{ github.workspace }}/proj-data
echo ".. 1/2 qgis database"
mkdir -p ${{ github.workspace }}/proj-data/resources
${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/share/qgis/proj/qgis.db ${{ github.workspace }}/proj-data/resources/
${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/share/qgis/proj/srs.db ${{ github.workspace }}/proj-data/resources/
echo ".. 2/2 proj resources"
mkdir -p ${{ github.workspace }}/proj-data/proj
${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/share/proj/* ${{ github.workspace }}/proj-data/proj/
PROJ_TAR=input-sdk-proj-mac-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz
echo "PROJ_TAR=${PROJ_TAR}" >> $GITHUB_ENV
cd "${{ github.workspace }}/proj-data"
find ./
tar -c -z -f ${{ github.workspace }}/${PROJ_TAR} ./
- name: Create SDK data folder
run: |
mkdir -p ${{ github.workspace }}/sdk
cp -R ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/x64-osx/* ${{ 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=input-sdk-qt-${{ env.QT_VERSION }}-mac-${{ 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_TAR artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.SDK_TAR }}
if-no-files-found: error

- name: Upload SUPPORTED_FORMATS artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.SUPPORTED_FORMATS }}
if-no-files-found: error

- name: Upload PROJ_TAR artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.PROJ_TAR }}
if-no-files-found: error
Expand Down
83 changes: 41 additions & 42 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:

env:
QT_VERSION: '6.5.2'
CACHE_VERSION: 1
ARCH: "win64"
TRIPLET: "x64-windows"
VS_VERSION: "2019"
Expand All @@ -31,6 +30,7 @@ jobs:
QT_ARCH: "win64_msvc2019_64" # run: aqt list $QT_VERSION windows desktop
VCPKG_BASELINE: "2f6176ce98fee807a207dc9e8fec213f111c291b" # use scripts/update_vcpkg_base.bash to change
VCPKG_ROOT: "C:/vcpkg-root" # Looks like there is more space on C: than on D: drive (~14GB)
CACHE_VERSION: 0

steps:
- run: Get-PSDrive
Expand All @@ -41,43 +41,24 @@ jobs:
id: vars
shell: bash
run: |
# Check deps versions change
DEPS_CHECKSUM=`md5sum vcpkg-test/vcpkg.json | cut -d\ -f1`
echo "::set-output name=DEPS_CHECKSUM::$DEPS_CHECKSUM"
echo "DEPS_CHECKSUM: $DEPS_CHECKSUM"
WORKSPACE_DIR=$(cygpath -m "${{ github.workspace }}")
echo "::set-output name=WORKSPACE_DIR::$WORKSPACE_DIR"
echo "WORKSPACE_DIR: $WORKSPACE_DIR"
- name: Clone 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
git checkout $VCPKG_BASELINE
- name: Cache vcpkg
id: cache-vcpkg-tool
uses: pat-s/[email protected]
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_BASELINE }}-v${{ env.CACHE_VERSION }}-${{ env.QT_VERSION }}

- name: Prepare build cache for branch/tag
# use a fork of actions/cache@v2 to upload cache even when the build or test failed
uses: pat-s/[email protected]
- name: Restore vcpkg folder
id: cache-build-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/build
# The branch or tag ref that triggered the workflow run. For branches this in the format refs/heads/<branch_name>, and for tags it is refs/tags/<tag_name>
key: cache-${{ steps.vars.outputs.DEPS_CHECKSUM }}-v${{ env.CACHE_VERSION }}-${{ env.QT_VERSION }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
cache-${{ steps.vars.outputs.DEPS_CHECKSUM }}-v${{ env.CACHE_VERSION }}-${{ env.QT_VERSION }}-${{ github.ref }}-
cache-${{ steps.vars.outputs.DEPS_CHECKSUM }}-v${{ env.CACHE_VERSION }}-${{ env.QT_VERSION }}-refs/heads/master-
key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }}

- uses: actions/checkout@v3
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
with:
repository: microsoft/vcpkg
path: ${ env.VCPKG_ROOT }

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -94,11 +75,6 @@ jobs:
run: |
CALL "C:\Program Files (x86)\Microsoft Visual Studio\${{ env.VS_VERSION }}\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ env.CMAKE_ARCH }}
- name: check QT installation
shell: cmd
run: |
DIR /s /b ${{ env.Qt6_Dir }}\lib\cmake
- name: Build Deps
shell: pwsh
run: |
Expand Down Expand Up @@ -132,6 +108,14 @@ jobs:
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-build-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}

- name: Build Test App
shell: pwsh
run: |
Expand All @@ -156,7 +140,7 @@ jobs:
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
exec { ${{ github.workspace }}\build\${{ env.ARCH }}\Release\inputsdktest.exe }
exec { ${{ github.workspace }}\build\${{ env.ARCH }}\Release\merginmapsinputsdk.exe }
- name: Get TimeStamp
id: time
Expand All @@ -165,17 +149,32 @@ jobs:
timeZone: 8
format: 'YYYYMMDD'

- name: Create package
- name: Create SDK data folder
shell: bash
run: |
mkdir -p ${{ github.workspace }}/sdk
cp -R ${{ github.workspace }}/build/${{ env.ARCH }}/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/*
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=input-sdk-qt-${{ env.QT_VERSION }}-win64-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV
find ${{ github.workspace }}/sdk/bin/ | grep dll
- name: Create ZIP package
uses: thedoctor0/[email protected]
with:
type: 'zip'
directory: build/${{ env.ARCH }}/vcpkg_installed/${{ env.TRIPLET }}/
filename: ${{ steps.vars.outputs.WORKSPACE_DIR }}/input-sdk-qt-${{ env.QT_VERSION }}-win64-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip
directory: sdk/
filename: ${{ steps.vars.outputs.WORKSPACE_DIR }}/${{ env.SDK_TAR }}

- name: Upload Sdk in Artifacts
uses: actions/upload-artifact@v2
with:
path: ${{ steps.vars.outputs.WORKSPACE_DIR }}/input-sdk-qt-${{ env.QT_VERSION }}-win64-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip
path: ${{ steps.vars.outputs.WORKSPACE_DIR }}/${{ env.SDK_TAR }}
if-no-files-found: error

- name: Create Release
Expand Down
Loading

0 comments on commit ad77091

Please sign in to comment.