Integration Tests #112
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: Integration Tests | |
on: | |
merge_group: | |
schedule: | |
- cron: '50 1 * * SUN' | |
pull_request: | |
types: [synchronize, labeled] | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
provertype: | |
description: 'invoke real vs mock prover' | |
required: true | |
default: 'mock_prover' | |
type: choice | |
options: | |
- real_prover | |
- mock_prover | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
set-outputs: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
outputs: | |
instancetype: ${{ steps.set-outputs.outputs.instancetype }} | |
provertype: ${{ steps.set-outputs.outputs.provertype }} | |
steps: | |
- id: set-outputs | |
name: Select instance and prover type | |
run: | | |
if [ "${{ github.event.inputs.provertype }}" = "real_prover" ] || [ "${{ github.event_name }}" = "schedule" ]; then | |
echo "instancetype=r6i.32xlarge" >> "$GITHUB_OUTPUT" | |
echo "provertype=real_prover" >> "$GITHUB_OUTPUT" | |
elif [ "${{ github.event.inputs.provertype }}" = "mock_prover" ] || [ -z ${{ github.event.inputs.provertype }} ]; then | |
echo "instancetype=c5.9xlarge" >> "$GITHUB_OUTPUT" | |
echo "provertype=mock_prover" >> "$GITHUB_OUTPUT" | |
else | |
exit 1 | |
fi | |
integration-tests: | |
if: github.event.pull_request.draft == false | |
name: Integration Tests | |
runs-on: ["${{github.run_id}}", self-hosted, "${{needs.set-outputs.outputs.instancetype}}"] | |
needs: set-outputs | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
override: false | |
- name: Setup golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ~1.19 | |
# Go cache for building geth-utils | |
- name: Go cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# Run an initial build in a separate step to split the build time from execution time | |
- name: Build bins | |
run: cargo build --bin gen_blockchain_data | |
- name: Build tests | |
run: for testname in rpc circuit_input_builder circuits; do cargo test --profile release --test $testname --features $testname --no-run; done | |
- run: ./run.sh --steps "setup" | |
working-directory: integration-tests | |
- run: ./run.sh --steps "gendata" | |
working-directory: integration-tests | |
- run: ./run.sh --steps "tests" --tests "rpc" | |
working-directory: integration-tests | |
- run: ./run.sh --steps "tests" --tests "circuit_input_builder" | |
working-directory: integration-tests | |
- run: RUST_TEST_THREADS=1 ./run.sh --steps "tests" --tests "circuits::${{ needs.set-outputs.outputs.provertype }}" | |
working-directory: integration-tests | |
- run: ./run.sh --steps "cleanup" | |
working-directory: integration-tests |