Skip to content

Commit

Permalink
fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
yuunlimm committed Oct 1, 2024
1 parent 05fec3c commit ea61c58
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,54 @@ on:
workflow_dispatch:
inputs:
commit_hash:
description: 'Commit hash to use for the dependency update'
required: true
default: 'main'
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

# - name: Install Dependencies and Run Linter
# uses: ./.github/actions/dep_install_and_lint
# with:
# working-directory: rust
# Install toml-cli using cargo
- name: Install toml-cli
run: cargo install toml-cli

- name: list files
run: ls -la

# update commite haash in the cargo.toml and run tests
# Show Cargo.toml Before Update
- name: Show Cargo.toml Before Update
run: cat Cargo.toml # Print the contents of Cargo.toml before the update

# Update the Cargo.toml with the provided commit hash
- name: Update Cargo.toml with new commit hash
run: |
echo "Updating dependency in Cargo.toml to use commit hash ${{ github.event.inputs.commit_hash }}"
sed -i 's|git = "https://github.com/yuunlimm/test-workflow2.git", rev = ".*"|git = "https://github.com/yuunlimm/test-workflow2.git", rev = "${{ github.event.inputs.commit_hash }}"|g' demo/Cargo.toml
run: cat rust/Cargo.toml

# Update the aptos-system-utils dependency
# Update aptos-system-utils dependency using toml-cli
- name: Update aptos-system-utils dependency
run: |
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }}
echo "Updating aptos-system-utils dependency in Cargo.toml to use commit hash ${{ github.event.inputs.commit_hash }}"
sed -i '/aptos-system-utils = {/!b;n;s|rev = ".*"|rev = "${{ github.event.inputs.commit_hash }}"|' demo/Cargo.toml
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 the aptos-indexer-test-transactions dependency
- name: Update aptos-indexer-test-transactions dependency
# Update aptos-system-utils dependency using toml-cli
- name: Update aptos-system-utils dependency
run: |
echo "Updating aptos-indexer-test-transactions dependency in Cargo.toml to use commit hash ${{ github.event.inputs.commit_hash }}"
sed -i '/aptos-indexer-test-transactions = {/!b;n;s|rev = ".*"|rev = "${{ github.event.inputs.commit_hash }}"|' demo/Cargo.toml
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }}
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-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 Cargo.toml
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 ea61c58

Please sign in to comment.