@@ -259,51 +259,11 @@ jobs:
259259 - name : Check exception tracking
260260 if : ${{ !cancelled() }} && github.event_name == 'pull_request'
261261 run : |
262- problematic_files=()
263- while read -r file; do
264- if ! grep -qE '^{\.push raises: \[\](, gcsafe)?\.}$' "$file"; then
265- problematic_files+=("$file")
266- fi
267- done < <(git diff --name-only --diff-filter=AM --ignore-submodules HEAD^ HEAD | grep -E '\.nim$' || true)
268-
269- if (( ${#problematic_files[@]} )); then
270- echo "The following files do not have '{.push raises: [], gcsafe.}' (gcsafe optional):"
271- for file in "${problematic_files[@]}"; do
272- echo "- $file"
273- done
274- echo "See https://status-im.github.io/nim-style-guide/errors.exceptions.html"
275- exit 2
276- fi
277-
262+ scripts/check_exception_headers.sh
278263 - name : Check submodules
279264 if : ${{ !cancelled() }} && github.event_name == 'pull_request'
280265 run : |
281- while read -r file; do
282- commit="$(git -C "$file" rev-parse HEAD)"
283- commit_date=$(TZ=UTC0 git -C "$file" show -s --format='%cd' --date=iso-local HEAD)
284- if ! branch="$(git config -f .gitmodules --get "submodule.$file.branch")"; then
285- echo "Submodule '$file': '.gitmodules' lacks 'branch' entry"
286- exit 2
287- fi
288- # Without the `--depth=1` fetch, may run into 'error processing shallow info: 4'
289- if ! error="$(git -C "$file" fetch -q --depth=1 origin "+refs/heads/${branch}:refs/remotes/origin/${branch}")"; then
290- echo "Submodule '$file': Failed to fetch '$branch': $error (1)"
291- exit 2
292- fi
293- branch_commit_date=$(TZ=UTC0 git -C "$file" show -s --format='%cd' --date=iso-local "refs/remotes/origin/${branch}")
294- if [[ "${commit_date}" > "${branch_commit_date}" ]]; then
295- echo "Submodule '$file': '$commit' ($commit_date) is more recent than latest '$branch' ($branch_commit_date) (branch config: '.gitmodules')"
296- exit 2
297- fi
298- if ! error="$(git -C "$file" fetch -q --shallow-since="$commit_date" origin "+refs/heads/${branch}:refs/remotes/origin/${branch}")"; then
299- echo "Submodule '$file': Failed to fetch '$branch': $error (2)"
300- exit 2
301- fi
302- if ! git -C "$file" merge-base --is-ancestor "$commit" "refs/remotes/origin/$branch"; then
303- echo "Submodule '$file': '$commit' is not on '$branch' as of $commit_date (branch config: '.gitmodules')"
304- exit 2
305- fi
306- done < <(git diff --name-only --diff-filter=AM HEAD^ HEAD | grep -f <(git config --file .gitmodules --get-regexp path | awk '{ print $2 }') || true)
266+ scripts/check_submodule_branches.sh
307267
308268 # https://github.com/EnricoMi/publish-unit-test-result-action
309269 event_file :
0 commit comments