-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (55 loc) · 2.19 KB
/
z3_trace_log_gen.yml
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
name: Z3 Trace Log Generator
on:
push:
branches: [ "main" ]
# only triggers job when smt2 files are changed (added/removed/modified) in a push
paths:
- '**/*.smt2'
# job can also be triggered manually on GitHub
workflow_dispatch:
jobs:
generate_log:
strategy:
matrix:
z3version: ['4.12.2', '4.11.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # this copies the whole repository
with:
fetch-depth: 0 # needed, see GitHub Action "Changed Files"
- name: Install Z3
uses: pavpanchekha/[email protected] # see GitHub Action "Install Z3"
with:
version: ${{ matrix.z3version }}
# this fetches all changed (added/modified) smt2 files in the repository
- name: Fetch changed smt2 files
id: changed-smt2-files
uses: tj-actions/[email protected] # see GitHub Action "Changed Files"
with:
files_yaml: |
smt:
- '**/*.smt2'
- name: Run Z3 solver on changed smt2 files and compress
id: run_z3_and_upload
run: |
# Create the 'logs' directory
mkdir logs
# Loop through the files
for file in ${{ steps.changed-smt2-files.outputs.smt_all_changed_files }}; do
echo "Processing $file"
# Get the filename without extension
base_name=$(basename "${file%.*}")
# Run Z3 solver for the file and save the log in the 'logs' directory
z3 trace=true proof=true trace-file-name=logs/${base_name}.log ./$file
done
# Compress the 'logs' directory using bzip2
z3_v_clean=$(echo "${{ matrix.z3version }}" | sed 's/\./_/g')
tar -cjf logs_z3_v_${z3_v_clean}.tar.bz2 logs/
echo "::set-output name=logs_path::$(realpath logs_z3_v_${z3_v_clean}.tar.bz2)"
env:
MATRIX_Z3VERSION: ${z3_v_clean}
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: "logs_z3_${{ steps.run_z3_and_upload.env.MATRIX_Z3VERSION }}.tar.bz2"
path: ${{ steps.run_z3_and_upload.outputs.logs_path }}