We currently have to re-run our integration tests a lot because they are depending on the whole repository. This pull request changes locks the clan-core used for vm tests. This has the caveat that we might not run the latest NixOS machine of our profiles. On the upside we can test behaviour against an older clan-core version and capture breakages and make it backwards compatible. If we actually want to test the latest version, the PR that changes the exposed flake api, could also bump the clan-core snapshot.
36 lines
771 B
Nix
36 lines
771 B
Nix
{
|
|
writeShellApplication,
|
|
git,
|
|
jq,
|
|
nix-prefetch-git,
|
|
}:
|
|
writeShellApplication {
|
|
name = "update-clan-core-for-checks";
|
|
runtimeInputs = [
|
|
git
|
|
jq
|
|
nix-prefetch-git
|
|
];
|
|
text = ''
|
|
reporoot=$(git rev-parse --show-toplevel)
|
|
if [ -z "$reporoot" ]; then
|
|
echo "Not in a git repository. Please run this script from the root of the repository."
|
|
exit 1
|
|
fi
|
|
cd "$reporoot"
|
|
# get latest commit of clan-core
|
|
json=$(nix-prefetch-git "$(pwd)")
|
|
sha256=$(jq -r '.sha256' <<< "$json")
|
|
rev=$(jq -r '.rev' <<< "$json")
|
|
|
|
cat > ./checks/clan-core-for-checks.nix <<EOF
|
|
{ fetchgit }:
|
|
fetchgit {
|
|
url = "https://git.clan.lol/clan/clan-core.git";
|
|
rev = "$rev";
|
|
sha256 = "$sha256";
|
|
}
|
|
EOF
|
|
'';
|
|
}
|