-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Upload artifacts created by libc-test
This gives us something that is easier to look at when the automatically generated tests fail.
- Loading branch information
Showing
2 changed files
with
45 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
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,25 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
# Create a tarball of intermediate output for inspection if tests fail. | ||
|
||
# Find the most recently touched file named "main.c" in the target directory. | ||
# This will be libc-tests's `OUT_DIR` | ||
out_dir="$( | ||
find target -name 'main.c' -exec ls -t {} + | | ||
head -n1 | | ||
xargs dirname | ||
)" | ||
|
||
out_name="archive-$(date -u -Iseconds | sed 's/://g')" | ||
(cd "$out_dir" && find -E . -regex '.*\.(rs|c)') > file_list.txt | ||
|
||
tar -czvf "${out_name}.tar.gz" -C "$out_dir" -T file_list.txt | ||
|
||
rm file_list.txt | ||
|
||
if [ -n "$CI" ]; then | ||
echo "ARCHIVE_NAME=${out_name}" >> "$GITHUB_ENV" | ||
echo "ARCHIVE_PATH=${out_name}.tar.gz" >> "$GITHUB_ENV" | ||
fi |