Skip to content

Commit

Permalink
gh workflow: cache aptos-debugger binary
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse committed Sep 11, 2024
1 parent 30820a5 commit 4f404d1
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/actions/build-aptos-debugger/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Build aptos-debugger binary"
description: Build aptos-debugger binary

inputs:
GIT_CREDENTIALS:
description: "Optional credentials to pass to git"
required: false
GIT_SHA:
required: true
type: string
description: The git SHA1 to test.

runs:
using: composite
steps:
- 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: Build aptos-debugger in release mode
shell: bash
run: cargo build --release -p aptos-debugger

- name: print pwd
run: pwd

- name: copy to working directory
run: cp target/release/aptos-debugger aptos-debugger
27 changes: 27 additions & 0 deletions .github/actions/get-aptos-debugger/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Build aptos-debugger binary"
description: Build aptos-debugger binary

inputs:
GIT_CREDENTIALS:
description: "Optional credentials to pass to git"
required: false
GIT_SHA:
required: true
type: string
description: The git SHA1 to test.

runs:
using: composite
steps:
- name: Check Cache
id: cache-aptos-debugger-binary
uses: actions/cache@v4
with:
path: aptos-debugger
key: aptos-debugger-${{ inputs.GIT_SHA }}

- uses: ./.github/actions/build-aptos-debugger
if: steps.cache-aptos-debugger-binary.outputs.cache-hit != 'true'
with:
GIT_SHA: ${{ inputs.GIT_SHA }}
GIT_CREDENTIALS: ${{ inputs.GIT_CREDENTIALS }}
45 changes: 45 additions & 0 deletions .github/workflows/workflow-run-replay-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,51 @@ on:
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 }}
Expand Down

0 comments on commit 4f404d1

Please sign in to comment.