-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixpkgs-vet: update CI, docs, and release to 0.1.4
We keep behind `pkgs/test/check-by-name/run-local.sh` and `pkgs/test/check-by-name/pinned-version.txt` as they are going to cause CI errors and confusion until we get all the way through the various channels. They'll be removed in about a week or so.
- Loading branch information
1 parent
c67a2a4
commit 9bece8f
Showing
11 changed files
with
119 additions
and
59 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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
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
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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
../../pkgs/test/nixpkgs-vet/run-local.sh |
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
19 changes: 9 additions & 10 deletions
19
pkgs/test/check-by-name/README.md → pkgs/test/nixpkgs-vet/README.md
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
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 @@ | ||
0.1.4 |
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,71 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p jq | ||
|
||
set -o pipefail -o errexit -o nounset | ||
|
||
trace() { echo >&2 "$@"; } | ||
|
||
tmp=$(mktemp -d) | ||
cleanup() { | ||
# Don't exit early if anything fails to cleanup | ||
set +o errexit | ||
|
||
trace -n "Cleaning up.. " | ||
|
||
[[ -e "$tmp/base" ]] && git worktree remove --force "$tmp/base" | ||
[[ -e "$tmp/merged" ]] && git worktree remove --force "$tmp/merged" | ||
|
||
rm -rf "$tmp" | ||
|
||
trace "Done" | ||
} | ||
trap cleanup exit | ||
|
||
|
||
repo=https://github.com/NixOS/nixpkgs.git | ||
|
||
if (( $# != 0 )); then | ||
baseBranch=$1 | ||
shift | ||
else | ||
trace "Usage: $0 BASE_BRANCH [REPOSITORY]" | ||
trace "BASE_BRANCH: The base branch to use, e.g. master or release-23.11" | ||
trace "REPOSITORY: The repository to fetch the base branch from, defaults to $repo" | ||
exit 1 | ||
fi | ||
|
||
if (( $# != 0 )); then | ||
repo=$1 | ||
shift | ||
fi | ||
|
||
if [[ -n "$(git status --porcelain)" ]]; then | ||
trace -e "\e[33mWarning: Dirty tree, uncommitted changes won't be taken into account\e[0m" | ||
fi | ||
headSha=$(git rev-parse HEAD) | ||
trace -e "Using HEAD commit \e[34m$headSha\e[0m" | ||
|
||
trace -n "Creating Git worktree for the HEAD commit in $tmp/merged.. " | ||
git worktree add --detach -q "$tmp/merged" HEAD | ||
trace "Done" | ||
|
||
trace -n "Fetching base branch $baseBranch to compare against.. " | ||
git fetch -q "$repo" refs/heads/"$baseBranch" | ||
baseSha=$(git rev-parse FETCH_HEAD) | ||
trace -e "\e[34m$baseSha\e[0m" | ||
|
||
trace -n "Creating Git worktree for the base branch in $tmp/base.. " | ||
git worktree add -q "$tmp/base" "$baseSha" | ||
trace "Done" | ||
|
||
trace -n "Merging base branch into the HEAD commit in $tmp/merged.. " | ||
git -C "$tmp/merged" merge -q --no-edit "$baseSha" | ||
trace -e "\e[34m$(git -C "$tmp/merged" rev-parse HEAD)\e[0m" | ||
trace -n "Reading pinned nixpkgs-vet version from pinned-version.txt.. " | ||
toolVersion=$(<"$tmp/merged/pkgs/test/nixpkgs-vet/pinned-version.txt") | ||
trace -e "\e[34m$toolVersion\e[0m" | ||
|
||
trace -n "Building tool.. " | ||
nix-build https://github.com/NixOS/nixpkgs-vet/tarball/"$toolVersion" -o "$tmp/tool" -A build | ||
trace "Running nixpkgs-vet.." | ||
"$tmp/tool/bin/nixpkgs-vet" --base "$tmp/base" "$tmp/merged" |
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