Skip to content

Commit fde43be

Browse files
powerboat9dkm
authored andcommitted
ci: Ignore non-rust warnings
This should make it easier for us to ignore warnings from outside the rust front end, and therefore make it easier for us to pull from upstream. ChangeLog: * .github/alpine_32bit_log_warnings: Remove lines. * .github/glibcxx_ubuntu64b_log_expected_warnings: Likewise. * .github/log_expected_warnings: Likewise. * .github/workflows/ccpp.yml: Filter out non-rust warnings. * .github/workflows/ccpp32alpine.yml: Likewise and remove redundant command. * .github/safe-grep: New shell script. Signed-off-by: Owen Avery <[email protected]>
1 parent 0b80bfa commit fde43be

File tree

6 files changed

+16
-588
lines changed

6 files changed

+16
-588
lines changed

.github/alpine_32bit_log_warnings

Lines changed: 0 additions & 150 deletions
Large diffs are not rendered by default.

.github/glibcxx_ubuntu64b_log_expected_warnings

Lines changed: 0 additions & 204 deletions
Large diffs are not rendered by default.

.github/log_expected_warnings

Lines changed: 0 additions & 229 deletions
Large diffs are not rendered by default.

.github/safe-grep

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
# grep exits with 1 if it doesn't match any lines
3+
# this script wraps grep, mapping exits codes 1->0, x->x
4+
5+
grep "$@"
6+
EXIT_CODE="$?"
7+
if [ x$EXIT_CODE = x1 ]; then
8+
exit 0
9+
else
10+
exit $EXIT_CODE
11+
fi

.github/workflows/ccpp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Check for new warnings
6969
run: |
7070
cd gccrs-build
71-
< log grep 'warning: ' | sort > log_warnings
71+
< log grep 'warning: ' | grep rust | sort > log_warnings
7272
if diff -U0 ../.github/log_expected_warnings log_warnings; then
7373
:
7474
else
@@ -153,7 +153,7 @@ jobs:
153153
- name: Check for new warnings
154154
run: |
155155
cd gccrs-build
156-
< log grep 'warning: ' | sort > log_warnings
156+
< log grep 'warning: ' | grep rust | sort > log_warnings
157157
if diff -U0 ../.github/glibcxx_ubuntu64b_log_expected_warnings log_warnings; then
158158
:
159159
else
@@ -237,7 +237,7 @@ jobs:
237237
- name: Check for new warnings
238238
run: |
239239
cd gccrs-build
240-
< log grep 'warning: ' | sort > log_warnings
240+
< log grep 'warning: ' | grep rust | sort > log_warnings
241241
if diff -U0 ../.github/log_expected_warnings log_warnings; then
242242
:
243243
else

.github/workflows/ccpp32alpine.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ jobs:
8080
- name: Produce warning logs
8181
run: |
8282
cd gccrs-build
83-
< log grep 'warning: ' | sort > log_warnings
83+
# grep exits with 1 if it doesn't find at least one match
84+
< log grep 'warning: ' | ../.github/safe-grep rust | sort > log_warnings
8485
cat log_warnings
8586
shell: alpine.sh {0}
8687
- name: Archive warnings logs
@@ -92,7 +93,6 @@ jobs:
9293
- name: Check for new warnings
9394
run: |
9495
cd gccrs-build
95-
< log grep 'warning: ' | sort > log_warnings
9696
if diff -U0 ../.github/alpine_32bit_log_warnings log_warnings; then
9797
:
9898
else

0 commit comments

Comments
 (0)