diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index c60fe2a3f..a51c780de 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -6,9 +6,9 @@ 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 @@ -16,46 +16,43 @@ on: 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: | 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 + 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 +# if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }} \ No newline at end of file