Skip to content

Commit

Permalink
Add verify-nixpkgs-revs step to codedown-languages
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Nov 21, 2023
1 parent c09f15d commit 2b92230
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ on:
workflow_dispatch:

jobs:
verify-nixpkgs-revs:
runs-on: self-hosted

steps:
- uses: actions/checkout@v3

- name: verify-default-nix.sh
if: "!contains(github.event.head_commit.message, 'noci')"
run: ./scripts/verify-default-nix.sh

test:
name: ${{matrix.suite}}
runs-on: self-hosted
Expand Down
8 changes: 0 additions & 8 deletions package.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPTDIR/.."

echo "args: {" > sample_environments.nix

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env sh

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPTDIR/.."

set -e

nix build '.#sample_environments_farm'
Expand Down
2 changes: 1 addition & 1 deletion update-default-nix.sh → scripts/update-default-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPTDIR
cd "$SCRIPTDIR/.."

output=$(nix flake metadata --json)

Expand Down
29 changes: 29 additions & 0 deletions scripts/verify-default-nix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env sh

set -e

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPTDIR"

FLAKE_NIXPKGS_REV=$(nix flake info --json | jq -r .locks.nodes.nixpkgs.locked.rev)
FLAKE_NIXPKGS_UNSTABLE_REV=$(nix flake info --json | jq -r '.locks.nodes["nixpkgs-unstable"].locked.rev')

echo "FLAKE_NIXPKGS_REV: $FLAKE_NIXPKGS_REV"
echo "FLAKE_NIXPKGS_UNSTABLE_REV: $FLAKE_NIXPKGS_UNSTABLE_REV"

DEFAULT_NIXPKGS_REV=$(cat default.nix | grep nixpkgs-rev | cut -d'"' -f2)
DEFAULT_NIXPKGS_UNSTABLE_REV=$(cat default.nix | grep nixpkgs-unstable-rev | cut -d'"' -f2)

echo "DEFAULT_NIXPKGS_REV: $DEFAULT_NIXPKGS_REV"
echo "DEFAULT_NIXPKGS_UNSTABLE_REV: $DEFAULT_NIXPKGS_UNSTABLE_REV"


if [ "$FLAKE_NIXPKGS_REV" != "$DEFAULT_NIXPKGS_REV" ]; then
echo "nixpkgs rev differed between flake and default.nix"
exit 1
fi

if [ "$FLAKE_NIXPKGS_UNSTABLE_REV" != "$DEFAULT_NIXPKGS_UNSTABLE_REV" ]; then
echo "nixpkgs-unstable rev differed between flake and default.nix"
exit 1
fi

0 comments on commit 2b92230

Please sign in to comment.