forked from bitcoin-core/guix.sigs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request bitcoin-core#27 from dongcarl/2021-06-ci-check
ci: Add sanity check
- Loading branch information
Showing
3 changed files
with
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
container: | ||
image: ubuntu:focal | ||
lint_task: | ||
only_if: $CIRRUS_BASE_BRANCH == 'main' | ||
lint_script: ./contrib/files-touched-check |
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,2 @@ | ||
*.SHA256SUMS -text -diff | ||
*.SHA256SUMS.asc -text -diff |
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,34 @@ | ||
#!/usr/bin/env bash | ||
export LC_ALL=C | ||
set -e -o pipefail | ||
export TZ=UTC | ||
|
||
while read -r status name; do | ||
|
||
case "$name" in | ||
README.md) continue ;; | ||
contrib/*) continue ;; | ||
21.99-guixtest1/*) continue ;; # guixtest1 used a different hierarchy | ||
esac | ||
|
||
if [ "$status" != "A" ]; then | ||
echo "ERR: File status is not 'A' (for add): '$status'" | ||
exit 1 | ||
fi | ||
|
||
if [[ $name =~ ^[^/]+/[^/]+/[^/]+.SHA256SUMS(|.asc)$ ]]; then | ||
if [ -z "$last_prefix" ]; then | ||
last_prefix="$(dirname "$name")" | ||
continue | ||
elif [ "$last_prefix" = "$(dirname "$name")" ]; then | ||
continue | ||
else | ||
echo "ERR: Added files need to be under the same prefix: '${last_prefix}'" | ||
exit 1 | ||
fi | ||
else | ||
echo "ERR: Added unknown file '$name'" | ||
exit 1 | ||
fi | ||
|
||
done < <(git diff --no-commit-id --name-status -r "${1:-${CIRRUS_BASE_SHA}...HEAD}") |