Skip to content

Commit 70bae4d

Browse files
authored
ci: subalfred uses self hosted runner
1 parent e87302b commit 70bae4d

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

.github/workflows/subalfred.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
jobs:
1111
check:
1212
name: Task check features
13-
runs-on: ubuntu-latest
13+
runs-on: self-hosted
1414

1515
steps:
1616
- name: ☁️ Checkout git repo

scripts/subalfred-check.sh

+26-8
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,42 @@ done
2727

2828
ERRORS=false
2929

30+
echo 🔎 Subalfred feature checks
3031
for dir in $(cat list); do
3132
echo
3233
RESULT=$(subalfred check features $dir)
3334
CHECK_RESULT=$? # 0 if it's good, anything else is bad
3435

36+
# If subalfred fails with 130||1, then we dont want to proceed with the check
37+
# Its probably cargo error
38+
if [[ $CHECK_RESULT == 130 || $CHECK_RESULT == 1 ]]; then
39+
echo "❌ Subalfred failed to run check features in $dir"
40+
echo "$RESULT"
41+
ERRORS=true
42+
43+
continue
44+
fi
45+
46+
# Sanitizing subalfred output
47+
# First line is always "checking: $PATH/Cargo.toml"
48+
RESULT=$(echo "$RESULT" | tail -n+2)
49+
3550
# Filter out false positives
3651
RESULT_OUTPUT=$(echo "$RESULT" | grep -vE "($1)")
52+
# Trim whitespaces
53+
RESULT_OUTPUT=${RESULT_OUTPUT##*( )}
54+
55+
# We are checking here if there is anything left in the output after filtering out false positives
56+
if [[ "$RESULT_OUTPUT" == "" ]]; then
57+
echo "$dir"
58+
continue
59+
fi
3760

3861
echo "$RESULT_OUTPUT" | grep '`std`' > /dev/null
3962
GREP_RESULT=$? # 0 if it's bad, 1 if it's good
4063

41-
if [[ -z "$RESULT_OUTPUT" ]]; then
42-
echo "🟡 $dir"
43-
fi
44-
# If there are no errors in subalfred check, then we're good
45-
if [[ $CHECK_RESULT == 0 ]]; then
46-
echo "$dir"
47-
4864
# If result is non empty and there are no std features, then we're yellow
49-
elif [[ "$GREP_RESULT" == 1 && "$CHECK_RESULT" != 0 && "$RESULT_OUTPUT" != "" ]]; then
65+
if [[ "$GREP_RESULT" == 1 && "$CHECK_RESULT" != 0 && "$RESULT_OUTPUT" != "" ]]; then
5066
echo "🟡 $dir"
5167
echo -e "$RESULT_OUTPUT"
5268

@@ -61,3 +77,5 @@ done
6177
if [[ $ERRORS == true ]]; then
6278
exit 1
6379
fi
80+
81+
rm list

0 commit comments

Comments
 (0)