Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuschen committed Oct 3, 2024
1 parent ebca87a commit 4a70465
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/miri-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Miri
env:
TARGET_BRANCH_COMMIT: ${{ github.event.pull_request.base.sha }}
run: |
echo "Target branch commit: $TARGET_BRANCH_COMMIT"
rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup
- name: Test with Miri
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: ./internal/scripts/ci_run_miri.sh
12 changes: 1 addition & 11 deletions internal/scripts/ci_run_miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,7 @@ if [[ "$line" == \#* ]]; then
continue
fi


# set contains all changed files comparing to the $TARGET_BRANCH_COMMIT
changes=$(git --no-pager diff --diff-filter=ACM --name-only $TARGET_BRANCH_COMMIT)
if [[ -z $changes ]]; then
# when it's not a pull request,
# the $TARGET_BRANCH_COMMIT will be empty so changes is empty as well,
# skip running 'cargo miri test' as it doesn't make sense.
exit 0
fi

if echo "$changes" | grep -q "$line"; then
if echo "$ALL_CHANGED_FILES" | grep -q "$line"; then
cd "$line" || { echo "Failed to change directory to $line"; exit 1; }
echo "Run cargo miri test under: $(pwd)"
cargo miri test
Expand Down

0 comments on commit 4a70465

Please sign in to comment.