forked from eclipse-iceoryx/iceoryx2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eclipse-iceoryx#421 from xieyuschen/iox2-60-suppor…
…t-miri-test-in-ci [eclipse-iceoryx#60] Integrate Miri in CI with an allow list
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Miri | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main, release* ] | ||
|
||
jobs: | ||
miri: | ||
name: "Miri" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Miri | ||
run: | | ||
rustup toolchain install nightly --component miri | ||
rustup override set nightly | ||
cargo miri setup | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# .miri_allowlist use hash character to lead a comment | ||
# each line will be treated as a valid relative path to enter and run 'cargo miri test', | ||
# if it contains some changed files(added, copied and modified, deletion is excluded) in the PR. | ||
# | ||
# note that each line should end up with a newline character, | ||
# otherwise the ci shell will skip the last line | ||
iceoryx2-bb/testing | ||
# this line is put here to ensure each file path contains a newline char, don't remove it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache Software License 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license | ||
# which is available at https://opensource.org/licenses/MIT. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
filename=".miri_allowlist" | ||
while IFS= read -r line; do | ||
if [[ "$line" == \#* ]]; then | ||
continue | ||
fi | ||
|
||
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 | ||
if [ $? -ne 0 ]; then | ||
echo "Error: cargo miri test failed." | ||
exit 1 | ||
fi | ||
cd - | ||
else | ||
echo "skip $line because the PR doesn't touch its files" | ||
fi | ||
done < "$filename" |