Skip to content

Commit

Permalink
Dont check cargo lock for Rust test guest
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Davies <[email protected]>
  • Loading branch information
simongdavies committed Feb 5, 2025
1 parent da37ab7 commit a31ce8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
33 changes: 5 additions & 28 deletions .github/workflows/ValidatePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
contents: write

jobs:
docs-and-common-deps-pr:
docs-pr:
runs-on: ubuntu-latest
outputs:
docs-only: ${{ steps.docs-only.outputs.result }}
Expand All @@ -32,9 +32,6 @@ jobs:
- '**/*.txt'
all:
- '**/*'
common_deps:
- '**/src/hyperlight_guest/Cargo.toml'
- '**/src/hyperlight_common/Cargo.toml'
- uses: actions/github-script@v7
id: docs-only
with:
Expand All @@ -43,42 +40,22 @@ jobs:
let all_file_count = ${{steps.changes.outputs.all_count}};
return all_file_count === docs_file_count;
result-encoding: string
# Check to see if this a dependabot PR and if it updates either the common or guest Cargo.toml files
# if it does we need to try and generate a new Cargo.lock file as the PR validation checks that these are up to date
- name: checkout
if: ${{ github.actor == 'dependabot[bot]' && steps.changes.outputs.common_deps_count > 0 }}
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Update Cargo.lock for dependabot changes
if: ${{ github.actor == 'dependabot[bot]' && steps.changes.outputs.common_deps_count > 0 }}
run: |
cargo update --manifest-path src/tests/rust_guests/simpleguest/Cargo.toml
cargo update --manifest-path src/tests/rust_guests/callbackguest/Cargo.toml
if [ -n "$(git status --porcelain src/tests/rust_guests/simpleguest/Cargo.lock src/tests/rust_guests/callbackguest/Cargo.lock)" ]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add src/tests/rust_guests/simpleguest/Cargo.lock
git add src/tests/rust_guests/callbackguest/Cargo.lock
git commit -m "Update Cargo.lock files for dependabot changes"
git push
fi

rust:
needs:
- docs-and-common-deps-pr
- docs-pr
uses: ./.github/workflows/dep_rust.yml
secrets: inherit
with:
docs_only: ${{needs.docs-and-common-deps-pr.outputs.docs-only}}
docs_only: ${{needs.docs-pr.outputs.docs-only}}

fuzzing:
needs:
- docs-and-common-deps-pr
- docs-pr
uses: ./.github/workflows/dep_fuzzing.yml
with:
max_total_time: 300 # 5 minutes in seconds
docs_only: ${{needs.docs-and-common-deps-pr.outputs.docs-only}}
docs_only: ${{needs.docs-pr.outputs.docs-only}}
secrets: inherit

spelling:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ jobs:
- name: clippy
run: just clippy ${{ matrix.config }}

# Does not check for updated Cargo.lock files for test rust guests as this causes an issue with this checkwhen deoendabot updates dependencies in common crates
- name: Ensure up-to-date Cargo.lock
run: |
cargo fetch --locked
cargo fetch --manifest-path src/tests/rust_guests/simpleguest/Cargo.toml --locked
cargo fetch --manifest-path src/tests/rust_guests/callbackguest/Cargo.toml --locked
- name: Get gh action service name
if: ${{ (runner.os == 'Windows' )}}
Expand Down

0 comments on commit a31ce8e

Please sign in to comment.