File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ KERNELS=$( find . -maxdepth 2 -name " build.toml" -exec dirname {} \; | sed ' s|^\./||' | sort)
6+
7+ FAILED_LIST=/tmp/verify-failed
8+ : > " $FAILED_LIST "
9+
10+ {
11+ for kernel in $KERNELS ; do
12+ echo " ::group::$kernel "
13+
14+ VERSION=$( awk -F' [[:space:]]*=[[:space:]]*' ' /^version/ {print $2; exit}' " $kernel /build.toml" )
15+
16+ # Continue on failure to verify all kernels before reporting.
17+ if ! nix run -L github:huggingface/kernels#kernels -- \
18+ verify-signature --all-variants " kernels-community/$kernel " " $VERSION " ; then
19+ echo " ::warning::$kernel verification FAILED"
20+ echo " $kernel " >> " $FAILED_LIST "
21+ fi
22+
23+ # Remove the HF cache to reclaim disk space before the next kernel.
24+ rm -rf ~ /.cache/huggingface/hub
25+
26+ echo " ::endgroup::"
27+ done
28+
29+ FAILURES=$( wc -l < " $FAILED_LIST " | tr -d ' [:space:]' )
30+ echo " "
31+ if [ " $FAILURES " -ne 0 ]; then
32+ echo " ❌ Verification failed for $FAILURES kernel(s):"
33+ sed ' s/^/ - /' " $FAILED_LIST "
34+ echo " "
35+ echo " See the corresponding groups above for details."
36+ else
37+ echo " ✅ All kernels verified successfully."
38+ fi
39+ } 2>&1 | tee /tmp/verify-output.log
40+
41+ [ -s " $FAILED_LIST " ] && exit 1 || exit 0
Original file line number Diff line number Diff line change 3434 - name : Verify all kernels
3535 env :
3636 HF_TOKEN : ${{ secrets.HF_TOKEN }}
37- run : |
38- KERNELS=$(find . -maxdepth 2 -name "build.toml" -exec dirname {} \; | sed 's|^\./||' | sort)
39-
40- {
41- for kernel in $KERNELS; do
42- echo "::group::$kernel"
43-
44- nix run -L github:huggingface/kernels#kernels -- \
45- verify-signature --all-variants "kernels-community/$kernel"
46-
47- # Remove the HF cache to reclaim disk space before the next kernel.
48- rm -rf ~/.cache/huggingface/hub
49-
50- echo "::endgroup::"
51- done
52- } 2>&1 | tee /tmp/verify-output.log
37+ run : .github/scripts/verify-signatures.sh
5338
5439 - name : Post results to Slack
5540 if : always()
You can’t perform that action at this time.
0 commit comments