Skip to content

Update fixtures

Update fixtures #185

Workflow file for this run

# Rebuilds proof fixtures for Solidity and Move for smart contract verification tests
# Then opens a pull request with the changes
# Note: This workflow takes over 30 minutes due to parallel E2E proof generation for `inclusion` and `epoch_change`
name: Update fixtures
on:
workflow_dispatch: { }
# Once per day at 00:00 UTC
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
generate-fixtures:
runs-on: warp-ubuntu-latest-x64-32x
timeout-minutes: 90
strategy:
matrix:
fixture: [ inclusion, epoch_change ]
language: [ solidity, move, pact ]
include:
- fixture-path: aptos/solidity/contracts/src/plonk_fixtures
language: solidity
- fixture-path: ethereum/move/sources/fixtures
language: move
- fixture-path: ethereum/pact/fixtures
language: pact
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
repository: argumentcomputer/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- name: Setup CI
uses: ./.github/actions/setup
- name: Generate ${{ matrix.language }} fixtures
run: |
cargo run --release -- --program ${{ matrix.fixture }} --language ${{ matrix.language }}
working-directory: ${{ github.workspace }}/fixture-generator
- name: Upload fixture artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.language }}_${{ matrix.fixture }}_fixture.json
path: ${{ github.workspace }}/${{ matrix.fixture-path }}/${{ matrix.fixture }}_fixture.json
if-no-files-found: error
overwrite: true
retention-days: 1
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/FIXTURES.md
create-pull-request:
needs: generate-fixtures
runs-on: ubuntu-latest
env:
SOLIDITY_FIXTURE_PATH: aptos/solidity/contracts/src/plonk_fixtures
MOVE_FIXTURE_PATH: ethereum/move/sources/fixtures
PACT_FIXTURE_PATH: ethereum/pact/fixtures
steps:
- uses: actions/checkout@v4
- name: Download Solidity fixtures
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.SOLIDITY_FIXTURE_PATH }}
pattern: "solidity_*"
merge-multiple: true
- name: Download Move fixtures
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.MOVE_FIXTURE_PATH }}
pattern: "move_*"
merge-multiple: true
- name: Download Pact fixtures
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.PACT_FIXTURE_PATH }}
pattern: "pact_*"
merge-multiple: true
- name: Test fixtures invariant
run: |
for fixture in epoch_change_fixture.json inclusion_fixture.json; do
echo "Testing $fixture"
jq -s '
(.[0].proof | length) as $proof_len |
(.[1].args[2].value | length) as $arg_value_len |
{ is_proof_longer: ($proof_len > $arg_value_len) }
' ${{ github.workspace }}/${{ env.PACT_FIXTURE_PATH }}/$fixture ${{ github.workspace }}/${{ env.MOVE_FIXTURE_PATH }}/$fixture |
jq -e '.is_proof_longer' > /dev/null || {
echo "Length assertion failed for $fixture."
exit 1
}
done
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/FIXTURES.md
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
branch: "ci-update-fixtures"
title: "chore: Update fixtures"
commit-message: "chore: Update fixtures"
labels: "automated-issue"
reviewers: "tchataigner, storojs72, wwared, huitseeker, samuelburnham"
body: |
This is an automated PR updating the proof fixtures for Solidity and Move, which are used for smart contract verification tests.
Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}