Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow cross repo workflow trigger (#526) #528

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
name: Run Integration Tests

on:
repository_dispatch:
types: [json-change-detected] # Custom event type to trigger the workflow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is it possible to make this more specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how specific are you thinking? I think we can though, it's all custom

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something like test-txn-json-change-detected?

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
Loading