refactor(tests): move state and forkchoice tests under forks/lstar (S… #226
This file contains hidden or 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: Production Test Vectors | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| name: Check key availability | |
| runs-on: ubuntu-latest | |
| outputs: | |
| scheme-changed: ${{ steps.scheme-diff.outputs.changed }} | |
| cache-hit: ${{ steps.key-cache.outputs.cache-hit }} | |
| steps: | |
| - name: Checkout leanSpec | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check if scheme changed | |
| id: scheme-diff | |
| run: | | |
| if git diff HEAD~1 --name-only | grep -qE '^src/lean_spec/subspecs/(xmss|poseidon2)/'; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Check prod key cache | |
| id: key-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: /tmp/prod-keys-probe | |
| key: prod-keys-${{ hashFiles('src/lean_spec/subspecs/xmss/**', 'src/lean_spec/subspecs/poseidon2/**') }} | |
| lookup-only: true | |
| keygen: | |
| name: Generate keys | |
| needs: check | |
| if: needs.check.outputs.cache-hit != 'true' && needs.check.outputs.scheme-changed == 'true' | |
| uses: ./.github/workflows/generate-keys.yml | |
| secrets: inherit | |
| fill: | |
| name: Fill production test fixtures | |
| needs: [check, keygen] | |
| # Trick to run even when keygen was skipped, but not on failure or cancel. | |
| if: always() && !failure() && !cancelled() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout leanSpec | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.14 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "pyproject.toml" | |
| - name: Sync dependencies | |
| run: uv sync --no-progress | |
| - name: Restore prod key cache | |
| id: key-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: packages/testing/src/consensus_testing/test_keys/prod_scheme | |
| key: prod-keys-${{ hashFiles('src/lean_spec/subspecs/xmss/**', 'src/lean_spec/subspecs/poseidon2/**') }} | |
| - name: Download keys | |
| if: steps.key-cache.outputs.cache-hit != 'true' | |
| run: uv run python -m consensus_testing.keys --download --scheme prod | |
| - name: Save key cache | |
| if: steps.key-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: packages/testing/src/consensus_testing/test_keys/prod_scheme | |
| key: prod-keys-${{ hashFiles('src/lean_spec/subspecs/xmss/**', 'src/lean_spec/subspecs/poseidon2/**') }} | |
| - name: Fill production test fixtures | |
| run: uv run fill --fork=Lstar --scheme prod --clean -n auto | |
| - name: Bundle keys with fixtures | |
| run: | | |
| mkdir -p fixtures/keys | |
| cp -r packages/testing/src/consensus_testing/test_keys/prod_scheme fixtures/keys/ | |
| - name: Upload fixtures + keys | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fixtures-prod-scheme | |
| path: fixtures/ | |
| if-no-files-found: error |