6
6
name : ci-msvc
7
7
8
8
on :
9
+ workflow_dispatch :
9
10
push :
10
11
paths :
11
12
- " **"
75
76
76
77
BUILD_PROJECTS_ES : exult_studio
77
78
79
+ VCPKGINSTALLED_PATH : ${{format('{0}/msvcstuff/vs2019/vcpkg_installed/x64-windows', github.workspace) }}
80
+
81
+ VCPKGINSTALLED_PATH_ES : ${{format('{0}/msvcstuff/vs2019/exult_studio/vcpkg_installed/x64-windows', github.workspace) }}
82
+
78
83
TARGET_VCPKG_MANIFEST_INSTALL : VcpkgInstallManifestDependencies
79
84
80
- VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
85
+ # No automatic binary caching until microsoft fixes it
86
+ VCPKG_BINARY_SOURCES : " clear"
81
87
88
+
82
89
permissions :
83
90
contents : read
84
91
@@ -91,35 +98,48 @@ jobs:
91
98
steps :
92
99
- uses : actions/checkout@v4
93
100
94
- - name : Export GitHub Actions cache environment variables
95
- uses : actions/github-script@v7
96
- with :
97
- script : |
98
- core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
99
- core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
100
-
101
101
- name : Add MSBuild to PATH
102
102
uses : microsoft/setup-msbuild@v2
103
103
104
- - name : Update and Integrate vcpkg
104
+ - name : Setup vcpkg for Exult
105
105
working-directory : ${{env.GITHUB_WORKSPACE}}
106
106
run : |
107
107
cd $Env:VCPKG_INSTALLATION_ROOT
108
- git fetch
109
- git merge --ff-only db1ddd0
110
108
.\bootstrap-vcpkg.bat
111
- vcpkg integrate install
109
+ ./vcpkg integrate install
110
+ 'VCPKG_REV='|Out-File -Append -NoNewLine ${{ github.env }}
111
+ git rev-parse HEAD|Out-File -Append ${{ github.env }}
112
112
113
+ - name : Restore VCPKG packages for Exult from Cache
114
+ uses : actions/cache/restore@v4
115
+ id : exult-vcpkg-cache-restore
116
+ with :
117
+ path : ${{env.VCPKGINSTALLED_PATH}}
118
+ # Use the git rev hash of vcpkg in the cache key because things are not
119
+ # entirely compatible between versions and when the Windows runner image
120
+ # updates about every 2 weeks the version of vcpkg is updated causing
121
+ # bad caching behaviour during the switch over period
122
+ key : exult-vcpkg-packages-${{env.VCPKG_REV}}-${{github.sha}}
123
+ restore-keys : |
124
+ exult-vcpkg-packages-${{env.VCPKG_REV}}
113
125
114
126
- name : Install VCPKG packages for Exult
115
127
working-directory : ${{env.GITHUB_WORKSPACE}}
116
128
run : msbuild /v:${{ runner.debug =='1' && 'detailed' || 'normal' }} /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}\Exult.vcxproj /t:${{env.TARGET_VCPKG_MANIFEST_INSTALL}}
117
129
130
+ - name : Save VCPKG packages for Exult to cache
131
+ id : exult-vcpkg-cache-save
132
+ uses : actions/cache/save@v4
133
+ with :
134
+ path : |
135
+ ${{env.VCPKGINSTALLED_PATH}}
136
+ key : exult-vcpkg-packages-${{env.VCPKG_REV}}-${{github.sha}}
137
+
118
138
- name : Build Exult
119
139
working-directory : ${{env.GITHUB_WORKSPACE}}
120
140
run : msbuild /v:${{ runner.debug =='1' && 'detailed' || 'normal' }} /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}} /t:${{env.BUILD_PROJECTS}}
121
- ci-msvc-exult_studio :
122
141
142
+ ci-msvc-exult_studio :
123
143
runs-on : windows-2022
124
144
if : ${{ github.repository_owner == 'exult' || github.repository_owner == 'wench' }}
125
145
@@ -136,19 +156,44 @@ jobs:
136
156
- name : Add MSBuild to PATH
137
157
uses : microsoft/setup-msbuild@v2
138
158
139
- - name : Update and Integrate vcpkg
159
+ - name : Setup vcpkg for Studio
140
160
working-directory : ${{env.GITHUB_WORKSPACE}}
141
161
run : |
142
162
cd $Env:VCPKG_INSTALLATION_ROOT
143
- git fetch
144
- git merge --ff-only db1ddd0
145
163
.\bootstrap-vcpkg.bat
146
- vcpkg integrate install
164
+ ./vcpkg integrate install
165
+ 'VCPKG_REV='|Out-File -Append -NoNewLine ${{ github.env }}
166
+ git rev-parse HEAD|Out-File -Append ${{ github.env }}
167
+
168
+ - name : Restore VCPKG packages for Studio from Cache
169
+ uses : actions/cache/restore@v4
170
+ id : studio-vcpkg-cache-restore
171
+ with :
172
+ path : ${{env.VCPKGINSTALLED_PATH_ES}}
173
+ key : studio-vcpkg-packages-${{env.VCPKG_REV}}-${{github.sha}}
174
+ restore-keys : |
175
+ studio-vcpkg-packages-${{env.VCPKG_REV}}
147
176
148
177
- name : Install VCPKG packages for Studio
149
178
working-directory : ${{env.GITHUB_WORKSPACE}}
150
179
run : msbuild /v:${{ runner.debug =='1' && 'detailed' || 'normal' }} /m /p:Configuration=${{env.BUILD_CONFIGURATION_ES}} /p:Platform=${{env.BUILD_PLATFORM_ES}} ${{env.SOLUTION_FILE_PATH}}\exult_studio\exult_studio.vcxproj /t:${{env.TARGET_VCPKG_MANIFEST_INSTALL}}
151
180
181
+ - name : Save Studio VCPKG packages to cache
182
+ id : studio-vcpkg-cache-save
183
+ uses : actions/cache/save@v4
184
+ with :
185
+ path : |
186
+ ${{env.VCPKGINSTALLED_PATH_ES}}
187
+ key : studio-vcpkg-packages-${{env.VCPKG_REV}}-${{github.sha}}
188
+
189
+ - name : Restore VCPKG packages for Exult from Cache
190
+ uses : actions/cache/restore@v4
191
+ id : exult-vcpkg-cache-restore
192
+ with :
193
+ path : ${{env.VCPKGINSTALLED_PATH}}
194
+ key : exult-vcpkg-packages-${{env.VCPKG_REV}}-${{github.sha}}
195
+ restore-keys : |
196
+ exult-vcpkg-packages-${{env.VCPKG_REV}}
152
197
- name : Build exult_studio
153
198
working-directory : ${{env.GITHUB_WORKSPACE}}
154
199
run : msbuild /v:${{ runner.debug =='1' && 'detailed' || 'normal' }} /m /p:Configuration=${{env.BUILD_CONFIGURATION_ES}} /p:Platform=${{env.BUILD_PLATFORM_ES}} ${{env.SOLUTION_FILE_PATH}} /t:${{env.BUILD_PROJECTS_ES}}
0 commit comments