Skip to content

Commit 528b851

Browse files
committed
GitHub actions: Make all Windows checks consistent
With the exceptions of whether or not to create packages, run tests, or do signing, make all three Windows configurations exactly the same. Apart from cleanliness, the main benefit is the use of clcache for all Windows build jobs, making them consistently faster: check-vs-2019-build-and-test now completes after 36 minutes instead of 74 minutes.
1 parent fbaf6dd commit 528b851

File tree

5 files changed

+44
-85
lines changed

5 files changed

+44
-85
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -175,29 +175,41 @@ jobs:
175175
check-vs-2019-build-and-test:
176176
runs-on: windows-2019
177177
env:
178-
SCRIPT_DIR: .github/workflows/vs2019
178+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
179179
steps:
180-
- name: Checkout the repository
181-
uses: actions/checkout@v2
180+
- uses: actions/checkout@v2
182181
with:
183-
submodules: recursive
184-
185-
- name: Install bison and flex
186-
run: "${{env.SCRIPT_DIR}}\\install-bison.bat"
187-
188-
- name: Install z3
182+
submodules: true
183+
- name: Fetch dependencies
189184
run: |
190-
Invoke-WebRequest "https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-win.zip" -OutFile z3.zip
191-
Expand-Archive z3.zip
192-
# We need Get-ChildItem.Name here because the path includes
193-
# the z3 version number, which we expect to change.
194-
echo "$(Get-Location)\z3\$((Get-ChildItem z3).Name)" >> $env:GITHUB_PATH
195-
196-
- name: Build cbmc
197-
run: "${{env.SCRIPT_DIR}}\\build-cbmc.bat"
198-
185+
choco install winflexbison3
186+
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
187+
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
188+
- name: Setup Visual Studio environment
189+
uses: microsoft/[email protected]
190+
- name: Prepare ccache
191+
uses: actions/cache@v2
192+
with:
193+
path: .ccache
194+
key: ${{ runner.os }}-msbuild-${{ github.ref }}-${{ github.sha }}
195+
restore-keys: |
196+
${{ runner.os }}-msbuild-${{ github.ref }}
197+
${{ runner.os }}-msbuild
198+
- name: ccache environment
199+
run: |
200+
echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV
201+
echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV
202+
- name: Configure with cmake
203+
run: cmake -S . -B build
204+
- name: Build Release
205+
run: cmake --build build --config Release -- /p:UseMultiToolTask=true /p:CLToolExe=clcache
206+
- name: Print ccache stats
207+
run: clcache -s
208+
- uses: ilammy/[email protected]
199209
- name: Test cbmc
200-
run: "${{env.SCRIPT_DIR}}\\run-tests.bat"
210+
run: |
211+
Set-Location build
212+
ctest -V -L CORE -C Release . -j2
201213
202214
check-clang-format:
203215
runs-on: ubuntu-20.04
@@ -239,21 +251,21 @@ jobs:
239251
MERGE_BRANCH: ${{ github.ref }}
240252
run: ./.github/workflows/pull-request-check-cpplint.sh
241253

242-
# I just added this to check if my stuff is working on github actions
243254
windows-msi-package:
244255
runs-on: windows-2019
245256
env:
246257
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
247258
steps:
248259
- uses: actions/checkout@v2
249260
with:
250-
submodules: recursive
261+
submodules: true
251262
- name: Fetch dependencies
252263
run: |
253264
choco install winflexbison3
254265
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
255266
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
256-
- uses: microsoft/[email protected]
267+
- name: Setup Visual Studio environment
268+
uses: microsoft/[email protected]
257269
- name: Prepare ccache
258270
uses: actions/cache@v2
259271
with:
@@ -267,14 +279,9 @@ jobs:
267279
echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV
268280
echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV
269281
- name: Configure with cmake
270-
run: |
271-
New-Item -ItemType Directory -Path build
272-
Set-Location build
273-
cmake ..
282+
run: cmake -S . -B build
274283
- name: Build Release
275-
run: |
276-
Set-Location build
277-
cmake --build . --config Release -- /p:UseMultiToolTask=true /p:CLToolExe=clcache
284+
run: cmake --build build --config Release -- /p:UseMultiToolTask=true /p:CLToolExe=clcache
278285
- name: Print ccache stats
279286
run: clcache -s
280287
- name: Create packages

.github/workflows/release-packages.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,16 @@ jobs:
138138
steps:
139139
- uses: actions/checkout@v2
140140
with:
141-
submodules: recursive
141+
submodules: true
142142
- name: Fetch dependencies
143143
run: |
144144
choco install winflexbison3
145145
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
146146
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
147-
- uses: microsoft/[email protected]
148-
name: Setup Visual Studio environment
147+
- name: Setup Visual Studio environment
148+
uses: microsoft/[email protected]
149149
- name: Setup code sign environment
150-
run: |
150+
run: |
151151
echo "$(Split-Path -Path $(Get-ChildItem -Path ${env:ProgramFiles(x86)} -Recurse -Filter 'signtool.exe' | Where-Object FullName -like '*10.0.19041.0\x64\signtool.exe').FullName)" >> $env:GITHUB_PATH
152152
echo "pfxcert=$([string](Get-Location)+'\CodeSignCertificate.pfx')" >> $env:GITHUB_ENV
153153
- name: Prepare ccache
@@ -163,18 +163,15 @@ jobs:
163163
echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV
164164
echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV
165165
- name: Configure with cmake
166-
run: |
167-
New-Item -ItemType Directory -Path build
168-
Set-Location build
169-
cmake ..
166+
run: cmake -S . -B build
170167
- name: Build Release
171-
run: |
172-
Set-Location build
173-
cmake --build . --config Release -- /p:UseMultiToolTask=true /p:CLToolExe=clcache
168+
run: cmake --build build --config Release -- /p:UseMultiToolTask=true /p:CLToolExe=clcache
174169
- name: Print ccache stats
175170
run: clcache -s
176171
- name: Create packages
177172
id: create_packages
173+
# We need to get the path to cpack because fascinatingly,
174+
# chocolatey also includes a command called "cpack" which takes precedence
178175
run: |
179176
Set-Location build
180177
$cpack = "$(Split-Path -Parent (Get-Command cmake).Source)\cpack.exe"

.github/workflows/vs2019/build-cbmc.bat

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/vs2019/install-bison.bat

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/vs2019/run-tests.bat

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)