-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the proto update workflow. (#15568)
- Loading branch information
1 parent
20e25a4
commit e3fdc51
Showing
2 changed files
with
106 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Checks the proto changes and release | ||
'on': | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened, auto_merge_enabled] | ||
branches: | ||
- main | ||
paths: | ||
- protos/proto/aptos/transaction/v1/transaction.proto | ||
|
||
jobs: | ||
check-protos: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Install buf, which we use to generate code from the protos for Rust and TS. | ||
- name: Install buf | ||
uses: bufbuild/[email protected] | ||
with: | ||
version: 1.28.1 | ||
- uses: pre-commit/[email protected] | ||
# Install protoc itself. | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v2 | ||
with: | ||
version: "25.x" | ||
# Set up pnpm. | ||
- uses: pnpm/action-setup@v4 | ||
# Set up Poetry. | ||
- name: Install Python deps for generating code from protos | ||
uses: ./.github/actions/python-setup | ||
with: | ||
pyproject_directory: ./protos/python | ||
# Install the Rust, TS, and Python codegen deps. | ||
- name: Install deps for generating code from protos | ||
run: cd protos && ./scripts/install_deps.sh | ||
# Finally, generate code based on the protos. | ||
- name: Generate code | ||
run: cd protos && ./scripts/build_protos.sh | ||
|
||
- name: Confirm that nothing has changed | ||
run: git diff --exit-code | ||
update-sdk: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
if: | # Only run on each PR once an appropriate event occurs | ||
( | ||
github.event_name == 'push' || | ||
contains(github.event.pull_request.labels.*.name, 'indexer-sdk-update') | ||
) | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Install buf, which we use to generate code from the protos for Rust and TS. | ||
- name: Install buf | ||
uses: bufbuild/[email protected] | ||
with: | ||
version: 1.28.1 | ||
|
||
- name: Check the format of the proto files | ||
run: | | ||
set -e | ||
buf format -d aptos/transaction/v1/transaction.proto --exit-code | ||
working-directory: protos/proto | ||
- name: Capture the commit hash | ||
id: commit_hash | ||
run: | | ||
# Echo the commit hash to the output | ||
echo "::set-output name=commit_hash::$(echo $GITHUB_SHA)" | ||
# Echo the PR branch name to the output | ||
echo "::set-output name=branch_name::${{ github.head_ref }}" | ||
- name: Google Cloud Auth | ||
id: auth | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} | ||
- name: Get Secret Manager Secrets | ||
id: secrets | ||
uses: 'google-github-actions/get-secretmanager-secrets@v2' | ||
with: | ||
secrets: |- | ||
token:aptos-ci/github-actions-repository-dispatch | ||
- name: Dispatch Event to SDK Repo | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ steps.secrets.outputs.token }} | ||
repository: 'aptos-labs/aptos-indexer-processor-sdk' | ||
event-type: 'proto-dependency-update' | ||
client-payload: '{"commit_hash": "${{ github.sha }}", "branch_name": "${{ steps.commit_hash.outputs.branch_name }}"}' | ||
# TOOD: enable this once the forge test is stable. | ||
# - name: Run Forge Tests | ||
# uses: ./.github/workflows/workflow-run-forge | ||
# with: | ||
# GIT_SHA: ${{ github.sha }} | ||
# FORGE_TEST_SUITE: sdk_update | ||
# IMAGE_TAG: ${{ github.sha }} | ||
# FORGE_RUNNER_DURATION_SECS: 3600 | ||
# COMMENT_HEADER: forge-sdk-update | ||
# FORGE_NAMESPACE: forge-sdk-update-namespace | ||
# SKIP_JOB: ${{ !contains(github.event.pull_request.labels.*.name, 'CICD:run-sdk-update-test') }} | ||
# SEND_RESULTS_TO_TRUNK: true |