gh workflow: cache aptos-debugger binary #12
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: "*run replay-verify reusable workflow" | |
on: | |
# This allows the workflow to be triggered from another workflow | |
workflow_call: | |
inputs: | |
GIT_SHA: | |
required: true | |
type: string | |
description: The git SHA1 to test. | |
# replay-verify config | |
BUCKET: | |
required: true | |
type: string | |
description: The bucket to use for the backup. If not specified, it will use the default bucket. | |
SUB_DIR: | |
required: true | |
type: string | |
description: The subdirectory to use for the backup. If not specified, it will use the default subdirectory. | |
HISTORY_START: | |
required: true | |
type: string | |
description: The history start to use for the backup. If not specified, it will use the default history start. | |
TXNS_TO_SKIP: | |
required: false | |
type: string | |
description: The list of transaction versions to skip. If not specified, it will use the default list. | |
BACKUP_CONFIG_TEMPLATE_PATH: | |
description: "The path to the backup config template to use." | |
type: string | |
required: true | |
# GHA job config | |
RUNS_ON: | |
description: "The runner to use for the job." | |
type: string | |
required: true | |
default: "high-perf-docker-with-local-ssd" | |
TIMEOUT_MINUTES: | |
description: "Github job timeout in minutes" | |
type: number | |
required: true | |
default: 720 | |
# This allows the workflow to be triggered manually from the Github UI or CLI | |
# NOTE: because the "number" type is not supported, we default to 720 minute timeout | |
workflow_dispatch: | |
inputs: | |
GIT_SHA: | |
required: true | |
type: string | |
description: The git SHA1 to test. | |
# replay-verify config | |
BUCKET: | |
required: true | |
type: string | |
description: The bucket to use for the backup. If not specified, it will use the default bucket. | |
SUB_DIR: | |
required: true | |
type: string | |
description: The subdirectory to use for the backup. If not specified, it will use the default subdirectory. | |
HISTORY_START: | |
required: true | |
type: string | |
description: The history start to use for the backup. If not specified, it will use the default history start. | |
TXNS_TO_SKIP: | |
required: false | |
type: string | |
description: The list of transaction versions to skip. If not specified, it will use the default list. | |
BACKUP_CONFIG_TEMPLATE_PATH: | |
description: "The path to the backup config template to use." | |
type: string | |
required: true | |
# GHA job config | |
RUNS_ON: | |
description: "The runner to use for the job." | |
type: string | |
required: true | |
default: "high-perf-docker-with-local-ssd" | |
jobs: | |
build: | |
runs-on: ${{ inputs.RUNS_ON }} | |
steps: | |
- name: Check Cache | |
id: cache-aptos-debugger-binary | |
uses: actions/cache@v4 | |
with: | |
path: aptos-debugger | |
key: aptos-debugger-${{ inputs.GIT_SHA }} | |
- uses: actions/checkout@v4 | |
if: steps.cache-aptos-debugger-binary.outputs.cache-hit != 'true' | |
with: | |
ref: ${{ inputs.GIT_SHA }} | |
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main | |
if: steps.cache-aptos-debugger-binary.outputs.cache-hit != 'true' | |
with: | |
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }} | |
- name: Install GCloud SDK | |
uses: "google-github-actions/setup-gcloud@v2" | |
with: | |
version: ">= 418.0.0" | |
install_components: "kubectl,gke-gcloud-auth-plugin" | |
- name: Build CLI binaries in release mode | |
shell: bash | |
run: cargo build --release -p aptos-debugger | |
- name: Run replay-verify in parallel | |
shell: bash | |
run: testsuite/replay_verify.py ${{ matrix.number }} 19 # first argument is the runner number, second argument is the total number of runners | |
env: | |
BUCKET: ${{ inputs.BUCKET }} | |
SUB_DIR: ${{ inputs.SUB_DIR }} | |
HISTORY_START: ${{ inputs.HISTORY_START }} | |
TXNS_TO_SKIP: ${{ inputs.TXNS_TO_SKIP }} | |
BACKUP_CONFIG_TEMPLATE_PATH: ${{ inputs.BACKUP_CONFIG_TEMPLATE_PATH }} | |
- name: Build aptos-debugger | |
if: steps.cache-aptos-debugger-binary.outputs.cache-hit != 'true' | |
replay-verify: | |
timeout-minutes: ${{ inputs.TIMEOUT_MINUTES || 720 }} | |
runs-on: ${{ inputs.RUNS_ON }} | |
strategy: | |
fail-fast: false | |
matrix: | |
number: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] # runner number | |
steps: | |
- name: Echo Runner Number | |
run: echo "Runner is ${{ matrix.number }}" | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.GIT_SHA }} | |
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main | |
with: | |
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }} | |
- name: Install GCloud SDK | |
uses: "google-github-actions/setup-gcloud@v2" | |
with: | |
version: ">= 418.0.0" | |
install_components: "kubectl,gke-gcloud-auth-plugin" | |
- name: Build CLI binaries in release mode | |
shell: bash | |
run: cargo build --release -p aptos-debugger | |
- name: Run replay-verify in parallel | |
shell: bash | |
run: testsuite/replay_verify.py ${{ matrix.number }} 19 # first argument is the runner number, second argument is the total number of runners | |
env: | |
BUCKET: ${{ inputs.BUCKET }} | |
SUB_DIR: ${{ inputs.SUB_DIR }} | |
HISTORY_START: ${{ inputs.HISTORY_START }} | |
TXNS_TO_SKIP: ${{ inputs.TXNS_TO_SKIP }} | |
BACKUP_CONFIG_TEMPLATE_PATH: ${{ inputs.BACKUP_CONFIG_TEMPLATE_PATH }} |