-
Notifications
You must be signed in to change notification settings - Fork 52
125 lines (106 loc) · 4.25 KB
/
Copy pathci-windows-minimal.yml
File metadata and controls
125 lines (106 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: windows-x64-Release-minimal
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
VCPKG_VERSION: 'master'
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
matrix:
os: ['windows-latest']
include:
- os: 'windows-latest'
triplet: 'x64-windows'
mono: ''
VCPKG_WORKSPACE: 'c:/vcpkg_own'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Vulkan SDK
uses: pelicanmapping/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.3.231.1
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Cache vcpkg repository
uses: actions/cache@v4
id: vcpkg-repo-cache
with:
path: ${{ matrix.VCPKG_WORKSPACE }}/vcpkg
key: ${{ runner.os }}-vcpkg-repo-${{ env.VCPKG_VERSION }}
- name: Installing vcpkg (windows)
if: steps.vcpkg-repo-cache.outputs.cache-hit != 'true'
shell: 'bash'
run: |
cmake -E make_directory ${{ matrix.VCPKG_WORKSPACE }}
cd ${{ matrix.VCPKG_WORKSPACE }}
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout ${{env.VCPKG_VERSION}}
cd ..
./vcpkg/bootstrap-vcpkg.bat -disableMetrics
- name: Bootstrap vcpkg if cached
if: steps.vcpkg-repo-cache.outputs.cache-hit == 'true'
shell: 'bash'
run: |
cd ${{ matrix.VCPKG_WORKSPACE }}/vcpkg
./bootstrap-vcpkg.bat -disableMetrics
- name: Configure vcpkg triplet
shell: 'bash'
run: |
echo "set(VCPKG_BUILD_TYPE release)" >> ${{ matrix.VCPKG_WORKSPACE }}/vcpkg/triplets/x64-windows.cmake
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/vcpkg version
- name: Setup NuGet binary cache
shell: 'bash'
run: |
nuget_exe=$(${{ matrix.VCPKG_WORKSPACE }}/vcpkg/vcpkg fetch nuget | tail -n 1)
"$nuget_exe" sources add \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Get vcpkg commit hash
id: vcpkg-commit
shell: bash
run: |
cd ${{ matrix.VCPKG_WORKSPACE }}/vcpkg
echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
path: |
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/installed
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/downloads
key: ${{ runner.os }}-vcpkg-deps-${{ steps.vcpkg-commit.outputs.hash }}-${{ matrix.triplet }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-deps-${{ steps.vcpkg-commit.outputs.hash }}-${{ matrix.triplet }}-
${{ runner.os }}-vcpkg-deps-${{ steps.vcpkg-commit.outputs.hash }}-
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{ runner.workspace }}/build
run: cmake $GITHUB_WORKSPACE -DWIN32_USE_MP=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DROCKY_SUPPORTS_GDAL=ON -DROCKY_SUPPORT_QT=OFF -DROCKY_SUPPORTS_MBTILES=OFF -DROCKY_SUPPORTS_AZURE=OFF -DROCKY_SUPPORTS_BING=OFF -DCMAKE_TOOLCHAIN_FILE=${{ matrix.VCPKG_WORKSPACE }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_BUILD_TYPE=$BUILD_TYPE -DVCPKG_MANIFEST_DIR=$GITHUB_WORKSPACE -DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/vcpkg-ports
- name: 'Upload cmake configure log artifact'
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: cmake-log
path: ${{ runner.workspace }}/build/CMakeCache.txt
retention-days: 1
- name: Build
working-directory: ${{ runner.workspace }}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE