Kani #167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Kani | |
on: | |
workflow_dispatch: | |
merge_group: | |
pull_request: | |
branches: [ main ] | |
push: | |
paths: | |
- 'library/**' | |
- '.github/workflows/kani.yml' | |
- 'scripts/run-kani.sh' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
check-kani-on-std: | |
name: Verify std library (partition ${{ matrix.partition }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
partition: [1, 2, 3, 4] | |
include: | |
- os: ubuntu-latest | |
base: ubuntu | |
- os: macos-latest | |
base: macos | |
fail-fast: false | |
env: | |
# Define the index of this particular worker [1-WORKER_TOTAL] | |
WORKER_INDEX: ${{ matrix.partition }} | |
# Total number of workers running this step | |
WORKER_TOTAL: 4 | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
path: head | |
submodules: true | |
# Step 2: Install jq | |
- name: Install jq | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y jq | |
# Step 3: Run Kani on the std library (default configuration) | |
- name: Run Kani Verification | |
run: head/scripts/run-kani.sh --path ${{github.workspace}}/head | |
run-kani-list: | |
name: Kani List | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
path: head | |
submodules: true | |
# Step 2: Run list on the std library | |
- name: Run Kani List | |
run: head/scripts/run-kani.sh --run list --path ${{github.workspace}}/head | |
# Step 3: Add output to job summary | |
- name: Add Kani List output to job summary | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const fs = require('fs'); | |
const kaniOutput = fs.readFileSync('${{github.workspace}}/head/kani-list.md', 'utf8'); | |
await core.summary | |
.addHeading('Kani List Output', 2) | |
.addRaw(kaniOutput, false) | |
.write(); | |
update-kani-metrics: | |
name: Compute Kani Metrics (partition ${{ matrix.partition }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
partition: [1, 2, 3, 4] | |
include: | |
- os: ubuntu-latest | |
base: ubuntu | |
- os: macos-latest | |
base: macos | |
fail-fast: false | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# The Kani metrics collection uses a Python script (kani_std_analysis.py), so make sure Python is installed | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Compute Kani Metrics | |
run: ./scripts/run-kani.sh --run metrics --path ${{github.workspace}} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: Update Kani metrics | |
title: 'Update Kani Metrics' | |
body: | | |
This is an automated PR to update Kani metrics. | |
The metrics have been updated by running `./scripts/run-kani.sh --run metrics`. | |
branch: update-kani-metrics | |
delete-branch: true | |
base: main | |