Skip to content

Commit 06d8ac7

Browse files
authored
Merge pull request #5625 from tautschnig/cleanup-vs-action
GitHub actions: Make all Windows checks consistent
2 parents 4a30b87 + 4535145 commit 06d8ac7

File tree

10 files changed

+84
-131
lines changed

10 files changed

+84
-131
lines changed

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

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
with:
12-
submodules: true
12+
submodules: recursive
1313
- name: Fetch dependencies
1414
env:
1515
# This is needed in addition to -yq to prevent apt-get from asking for
@@ -59,7 +59,7 @@ jobs:
5959
steps:
6060
- uses: actions/checkout@v2
6161
with:
62-
submodules: true
62+
submodules: recursive
6363
- name: Fetch dependencies
6464
env:
6565
# This is needed in addition to -yq to prevent apt-get from asking for
@@ -103,7 +103,7 @@ jobs:
103103
steps:
104104
- uses: actions/checkout@v2
105105
with:
106-
submodules: true
106+
submodules: recursive
107107
- name: Fetch dependencies
108108
run: brew install maven flex bison parallel ccache
109109
- name: Prepare ccache
@@ -143,7 +143,7 @@ jobs:
143143
steps:
144144
- uses: actions/checkout@v2
145145
with:
146-
submodules: true
146+
submodules: recursive
147147
- name: Fetch dependencies
148148
run: brew install cmake ninja maven flex bison ccache
149149
- name: Prepare ccache
@@ -175,36 +175,48 @@ 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:
183182
submodules: recursive
184-
185-
- name: Install bison and flex
186-
run: "${{env.SCRIPT_DIR}}\\install-bison.bat"
187-
188-
- name: Install z3
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
204216
steps:
205217
- uses: actions/checkout@v2
206218
with:
207-
submodules: true
219+
submodules: recursive
208220
fetch-depth: 0
209221
- name: Fetch dependencies
210222
env:
@@ -224,7 +236,7 @@ jobs:
224236
steps:
225237
- uses: actions/checkout@v2
226238
with:
227-
submodules: true
239+
submodules: recursive
228240
fetch-depth: 0
229241
- name: Fetch dependencies
230242
env:
@@ -239,7 +251,6 @@ 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:
@@ -253,7 +264,8 @@ jobs:
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: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ jobs:
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.

jbmc/regression/jbmc-json-ui/chain.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
JBMC_PATH=$1
44
shift
55

6-
JQ_COMMAND=$1
6+
JQ_FILTER_FILE=$1
77
shift
88

9-
$JBMC_PATH "$@" | jq -c "$JQ_COMMAND"
9+
$JBMC_PATH "$@" | jq -c -f $JQ_FILTER_FILE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.[] | select(has("result")) | .result | .[] | select(has("trace")) | .trace | .[] | select(has("value")) | .value | select(.name == "pointer") | {has_data: has("data")}

jbmc/regression/jbmc-json-ui/pointer-simplification/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test
3-
'.[] | select(has("result")) | .result | .[] | select(has("trace")) | .trace | .[] | select(has("value")) | .value | select(.name == "pointer") | {has_data: has("data")}' --json-ui --trace
3+
filter.jq --json-ui --trace
44
^EXIT=0$
55
^SIGNAL=0$
66
\{"has_data":true\}

regression/cbmc/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,11 @@ add_test_pl_profile(
2424
"CORE"
2525
)
2626

27+
# solver appears on the PATH in Windows already
2728
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
2829
set_property(
2930
TEST "cbmc-cprover-smt2-CORE"
3031
PROPERTY ENVIRONMENT
3132
"PATH=$ENV{PATH}:$<TARGET_FILE_DIR:smt2_solver>"
3233
)
33-
else()
34-
string(REPLACE ";" "\\;" path_value "$ENV{PATH}")
35-
set_property(
36-
TEST "cbmc-cprover-smt2-CORE"
37-
PROPERTY ENVIRONMENT
38-
"PATH=${path_value}\;$<TARGET_FILE_DIR:smt2_solver>"
39-
)
4034
endif()

regression/validate-trace-xml-schema/check.py

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,48 @@
1111
test_base_dir = os.path.abspath(os.path.join(this_script_dir, '..', 'cbmc'))
1212

1313
# some tests in the cbmc suite don't work for the trace checks for one reason or another
14-
ExcludedTests = list(map(lambda s: os.path.join(test_base_dir, s), [
14+
ExcludedTests = list(map(lambda s: os.path.join(test_base_dir, s[0], s[1]), [
1515
# these tests expect input from stdin
16-
'json-interface1/test_wrong_option.desc',
17-
'json-interface1/test.desc',
18-
'json-interface1/test_wrong_flag.desc',
19-
'xml-interface1/test_wrong_option.desc',
20-
'xml-interface1/test.desc',
21-
'xml-interface1/test_wrong_flag.desc',
16+
['json-interface1', 'test_wrong_option.desc'],
17+
['json-interface1', 'test.desc'],
18+
['json-interface1', 'test_wrong_flag.desc'],
19+
['xml-interface1', 'test_wrong_option.desc'],
20+
['xml-interface1', 'test.desc'],
21+
['xml-interface1', 'test_wrong_flag.desc'],
2222
# these want --show-goto-functions instead of producing a trace
23-
'destructors/compound_literal.desc',
24-
'destructors/enter_lexical_block.desc',
25-
'reachability-slice-interproc2/test.desc',
23+
['destructors', 'compound_literal.desc'],
24+
['destructors', 'enter_lexical_block.desc'],
25+
['reachability-slice-interproc2', 'test.desc'],
2626
# this one wants show-properties instead producing a trace
27-
'show_properties1/test.desc',
27+
['show_properties1', 'test.desc'],
2828
# program-only instead of trace
29-
'vla1/program-only.desc',
30-
'Quantifiers-simplify/simplify_not_forall.desc',
31-
# this one doesn't work for me locally at all
32-
# 'integer-assignments1/test.desc',
29+
['vla1', 'program-only.desc'],
30+
['Quantifiers-simplify', 'simplify_not_forall.desc'],
3331
# these test for invalid command line handling
34-
'bad_option/test_multiple.desc',
35-
'bad_option/test.desc',
36-
'unknown-argument-suggestion/test.desc',
32+
['bad_option', 'test_multiple.desc'],
33+
['bad_option', 'test.desc'],
34+
['unknown-argument-suggestion', 'test.desc'],
3735
# this one produces XML intermingled with main XML output when used with --xml-ui
38-
'graphml_witness2/test.desc',
36+
['graphml_witness2', 'test.desc'],
3937
# produces intermingled XML on the command line
40-
'coverage_report1/test.desc',
41-
'coverage_report1/paths.desc',
42-
'graphml_witness1/test.desc',
43-
'switch8/program-only.desc',
38+
['coverage_report1', 'test.desc'],
39+
['coverage_report1', 'paths.desc'],
40+
['graphml_witness1', 'test.desc'],
41+
['switch8', 'program-only.desc'],
4442
# this uses json-ui (fails for a different reason actually, but should also
4543
# fail because of command line incompatibility)
46-
'json1/test.desc',
44+
['json1', 'test.desc'],
4745
# uses show-goto-functions
48-
'reachability-slice/test.desc',
49-
'reachability-slice/test2.desc',
50-
'reachability-slice/test3.desc',
51-
'reachability-slice-interproc/test.desc',
52-
'unsigned1/test.desc',
53-
'reachability-slice-interproc3/test.desc',
54-
'sync_lock_release-1/symbol_per_type.desc',
55-
# this test is marked broken-smt-backend and doesn't work for me locally
56-
'integer-assignments1/test.desc'
46+
['reachability-slice', 'test.desc'],
47+
['reachability-slice', 'test2.desc'],
48+
['reachability-slice', 'test3.desc'],
49+
['reachability-slice-interproc', 'test.desc'],
50+
['unsigned1', 'test.desc'],
51+
['reachability-slice-interproc3', 'test.desc'],
52+
['sync_lock_release-1', 'symbol_per_type.desc'],
53+
# this test is marked smt-backend, and would thus fail as we run tests with
54+
# the SAT back-end only
55+
['integer-assignments1', 'test.desc']
5756
]))
5857

5958
# TODO maybe consider looking them up on PATH, but direct paths are

0 commit comments

Comments
 (0)