Skip to content

Client: Optimism

Client: Optimism #1423

Workflow file for this run

---
name: 'Client: Optimism'
on:
workflow_dispatch:
inputs:
branch_name:
description: 'Branch Name to Test From'
required: true
extra_args:
description: 'Additional Arguments to for run-kontrol.sh '
required: false
statuses_sha:
description: 'SHA of the commit to report back to'
required: false
org:
description: 'Organization to run the test for'
required: false
repository:
description: 'Repository to run the test for'
required: false
auth_token:
description: 'GitHub PAT to use for API calls'
required: false
# Multiple Runs will need to be allowed to queue
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.statuses_sha }}
cancel-in-progress: false
jobs:
optimism:
name: 'Optimism Kontrol CI'
runs-on: [self-hosted, linux, kaas]
timeout-minutes: 180 # Set limit to 3 hours
env:
GH_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT}}
steps:
- name: Report Pending Status
run: |
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.OPTIMISM_STATUSES_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${{ github.event.inputs.org }}/${{ github.event.inputs.repository }}/statuses/${{ github.event.inputs.statuses_sha }}" \
-d '{
"state": "pending",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Proofs Pending",
"context": "runtimeverification/proof-runner"
}'
- name: "Install KaaS"
uses: runtimeverification/install-kaas@v0.2.1
with:
github-token: ${{ secrets.JENKINS_GITHUB_PAT }}
- name: "Checkout Optimism"
uses: actions/checkout@v4
with:
repository: '${{ github.event.inputs.org }}/${{ github.event.inputs.repository }}'
token: ${{ secrets.JENKINS_GITHUB_PAT }}
path: 'optimism'
# ref: ${{ github.event.inputs.branch_name }}
fetch-depth: 0
submodules: 'recursive'
- name: Determine if the input branch is a PR and fetch it
run: |
pushd optimism > /dev/null
if [[ "${{ github.event.inputs.branch_name }}" == pull/* ]]; then
PR_NUMBER=$(echo "${{ github.event.inputs.branch_name }}" | cut -d'/' -f2)
git fetch origin pull/$PR_NUMBER/head:pr-$PR_NUMBER
git checkout pr-$PR_NUMBER
else
git checkout ${{ github.event.inputs.branch_name }}
fi
- name: "Set up Rust Toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Install mise"
shell: bash
run: |
curl https://mise.run | bash
echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
- name: "Install Dependencies"
shell: bash
run: |
pushd optimism > /dev/null
mise trust mise.toml
mise install
- name: "Generate Kontrol Summaries"
shell: bash
run: |
pushd optimism/packages/contracts-bedrock > /dev/null
just kontrol-summary
just kontrol-summary-fp
- name: "Download KCFG Cache Results"
shell: bash
continue-on-error: true
run: |
pushd optimism/packages/contracts-bedrock > /dev/null
tag=$(git hash-object ./test/kontrol/scripts/run-kontrol.sh)
kaas-cli download --token "${{ secrets.OPTIMISM_TOKEN }}" "runtimeverification/optimism-ci:$tag" -d ./kout-proofs/
- name: 'Run Kontrol'
shell: bash
run: |
set -xe
# Run the following in the running docker container
pushd optimism/packages/contracts-bedrock > /dev/null
# Need to checkout submodules, GH action doesn't do this properly.
git submodule update --init --recursive
./test/kontrol/scripts/run-kontrol.sh ${{ github.event.inputs.extra_args }}
- name: 'KCFG Upload Cache Results'
shell: bash
continue-on-error: true
run: |
pushd optimism/packages/contracts-bedrock > /dev/null
tag=$(git hash-object ./test/kontrol/scripts/run-kontrol.sh)
kaas-cli upload --token "${{ secrets.OPTIMISM_TOKEN }}" "runtimeverification/optimism-ci:$tag" -d ./kout-proofs/
- name: 'Upload KCFG Results to Summary'
if: always()
uses: actions/upload-artifact@v4.3.1
with:
name: Kontrol Results Folder
path: optimism/**/results-*tar.gz
retention-days: 14
- name: 'Upload Kontrol Prove Report'
if: always()
uses: actions/upload-artifact@v4.3.1
with:
name: Kontrol Prove Report
path: optimism/packages/contracts-bedrock/test/kontrol/logs/kontrol_prove_report.xml
retention-days: 14
- name: Report Pass Status
if: always() && success()
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.OPTIMISM_STATUSES_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.event.inputs.org}}/${{ github.event.inputs.repository}}/statuses/${{ github.event.inputs.statuses_sha }} \
-d '{
"state": "success",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Optimism Proof Execution Success",
"context": "runtimeverification/proof-runner"
}'
- name: Report Failure Status
if: always() && failure()
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.OPTIMISM_STATUSES_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.event.inputs.org}}/${{ github.event.inputs.repository}}/statuses/${{ github.event.inputs.statuses_sha }} \
-d '{
"state": "failure",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Proof Execution Failed",
"context": "runtimeverification/proof-runner"
}'
- name: Report Failure Status
if: always() && cancelled()
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.OPTIMISM_STATUSES_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.event.inputs.org}}/${{ github.event.inputs.repository}}/statuses/${{ github.event.inputs.statuses_sha }} \
-d '{
"state": "failure",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "Cancelled",
"context": "runtimeverification/proof-runner"
}'
- name: Send Status Failure to Slack
if: always() && failure()
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
"kontrol_status": "Failure",
"ci_run_link": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status }}\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.OPTIMISM_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK