Skip to content

Commit

Permalink
allow cross repo workflow trigger (#526) (#528)
Browse files Browse the repository at this point in the history
* allow cross repo workflow trigger (#526)

* fix path

* fix syntax

* update name
  • Loading branch information
yuunlimm authored Oct 1, 2024
1 parent 5772cdd commit 073fccf
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,56 @@ on:
repository_dispatch:
types: [json-change-detected] # Custom event type to trigger the workflow
workflow_dispatch:
inputs:
commit_hash:
description: 'Commit hash to use for the dependency update'
required: true
default: 'main'
push:
branches:
- main
pull_request:

jobs:
Integration-tests:
runs-on: runs-on,runner=2cpu-linux-x64,run-id=${{ github.run_id }}
runs-on: ubuntu-latest # Ensure the correct runner is used

steps:
- name: Checkout code
uses: actions/checkout@v3

# Install toml-cli using cargo
- name: Install toml-cli
run: cargo install toml-cli

# Show Cargo.toml Before Update
- name: Show Cargo.toml Before Update
run: cat rust/Cargo.toml

# Update aptos-system-utils dependency using toml-cli
- name: Update aptos-system-utils dependency
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }}
run: |
echo "Updating aptos-system-utils dependency in Cargo.toml to use commit hash ${{ github.event.inputs.commit_hash }}"
toml set rust/Cargo.toml workspace.dependencies.aptos-system-utils.rev "${{ github.event.inputs.commit_hash }}" > Cargo.tmp && mv Cargo.tmp rust/Cargo.toml
# Update aptos-indexer-test-transactions dependency using toml-cli
- name: Update aptos-indexer-test-transactions dependency
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }}
run: |
echo "Updating aptos-indexer-test-transactions dependency in Cargo.toml to use commit hash ${{ github.event.inputs.commit_hash }}"
toml set rust/Cargo.toml workspace.dependencies.aptos-indexer-test-transactions.rev "${{ github.event.inputs.commit_hash }}" > Cargo.tmp && mv Cargo.tmp rust/Cargo.toml
# Show Cargo.toml after the update
- name: Show Cargo.toml After Update
run: cat rust/Cargo.toml # Correct path to the Cargo.toml file

- name: Install Dependencies and Run Linter
uses: ./.github/actions/dep_install_and_lint
with:
working-directory: rust

# Run Integration Tests
- name: Run Integration Tests
run: cargo test --manifest-path integration-tests/Cargo.toml
working-directory: rust

0 comments on commit 073fccf

Please sign in to comment.