Skip to content

Commit f14ef45

Browse files
committed
Use log parser in workflow
1 parent 74bfab3 commit f14ef45

File tree

2 files changed

+105
-3
lines changed

2 files changed

+105
-3
lines changed

.github/workflows/kani.yml

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Run Kani Verification
5454
run: head/scripts/run-kani.sh --path ${{github.workspace}}/head
5555

56-
kani-autoharness:
56+
kani_autoharness:
5757
name: Verify std library using autoharness
5858
runs-on: ${{ matrix.os }}
5959
strategy:
@@ -124,7 +124,110 @@ jobs:
124124
--exclude-pattern ::precondition_check \
125125
--harness-timeout 5m \
126126
--default-unwind 1000 \
127-
--jobs=3 --output-format=terse
127+
--jobs=3 --output-format=terse | tee autoharness-verification.log
128+
gzip autoharness-verification.log
129+
130+
- name: Upload Autoharness Verification Log
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: ${{ matrix.os }}-autoharness-verification.log.gz
134+
path: autoharness-verification.log.gz
135+
if-no-files-found: error
136+
# Aggressively short retention: we don't really need these
137+
retention-days: 3
138+
139+
run_kani_metrics:
140+
name: Kani Metrics
141+
runs-on: ${{ matrix.os }}
142+
strategy:
143+
matrix:
144+
os: [ubuntu-latest, macos-latest]
145+
include:
146+
- os: ubuntu-latest
147+
base: ubuntu
148+
- os: macos-latest
149+
base: macos
150+
fail-fast: true
151+
152+
steps:
153+
# Step 1: Check out the repository
154+
- name: Checkout Repository
155+
uses: actions/checkout@v4
156+
with:
157+
submodules: true
158+
159+
# Step 2: Run list on the std library
160+
- name: Run Kani Metrics
161+
run: |
162+
scripts/run-kani.sh --run metrics --with-autoharness
163+
pushd /tmp/std_lib_analysis
164+
tar czf results.tar.gz results
165+
popd
166+
167+
- name: Upload kani-list.json
168+
uses: actions/upload-artifact@v4
169+
with:
170+
name: ${{ matrix.os }}-kani-list.json
171+
path: kani-list.json
172+
if-no-files-found: error
173+
# Aggressively short retention: we don't really need these
174+
retention-days: 3
175+
176+
- name: Upload scanner results
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: ${{ matrix.os }}-results.tar.gz
180+
path: /tmp/std_lib_analysis/results.tar.gz
181+
if-no-files-found: error
182+
# Aggressively short retention: we don't really need these
183+
retention-days: 3
184+
185+
run-log-analysis:
186+
name: TestLocalToolchain
187+
needs: [run_kani_metrics, kani_autoharness]
188+
runs-on: ${{ matrix.os }}
189+
strategy:
190+
matrix:
191+
os: [ubuntu-latest, macos-latest]
192+
include:
193+
- os: ubuntu-latest
194+
base: ubuntu
195+
- os: macos-latest
196+
base: macos
197+
fail-fast: false
198+
199+
steps:
200+
- name: Download log
201+
uses: actions/download-artifact@v4
202+
with:
203+
name: ${{ matrix.os }}-autoharness-verification.log.gz
204+
205+
- name: Download kani-list.json
206+
uses: actions/download-artifact@v4
207+
with:
208+
name: ${{ matrix.os }}-kani-list.json
209+
210+
- name: Download scanner results
211+
uses: actions/download-artifact@v4
212+
with:
213+
name: ${{ matrix.os }}-results.tar.gz
214+
215+
- name: Run log parser
216+
run: |
217+
gunzip ${{ matrix.os }}-autoharness-verification.log.gz
218+
tar xzf ${{ matrix.os }}-results.tar.gz
219+
python3 scripts/kani-std-analysis/log_parser.py \
220+
--kani-list-file kani-list.json \
221+
--analysis-results-dir results/ \
222+
${{ matrix.os }}-autoharness-verification.log \
223+
-o results.json
224+
225+
- name: Upload JSON
226+
uses: actions/upload-artifact@v4
227+
with:
228+
name: ${{ matrix.os }}-results.json
229+
path: results.json
230+
if-no-files-found: error
128231

129232
run-kani-list:
130233
name: Kani List

scripts/run-kani.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ main() {
340340
--kani-list-file $current_dir/kani-list.json \
341341
--metrics-file metrics-data-std.json
342342
popd
343-
rm kani-list.json
344343
elif [[ "$run_command" == "autoharness-analyzer" ]]; then
345344
echo "Running Kani autoharness codegen command..."
346345
"$kani_path" autoharness -Z autoharness -Z unstable-options --std ./library \

0 commit comments

Comments
 (0)