Skip to content

Commit

Permalink
gha: add nix jobs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnalotoski committed Dec 9, 2024
1 parent 86a95a3 commit 344913f
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/nix-jobs-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
on:
pull_request:

jobs:
nix-jobs-test:
name: "Test nix jobs"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{github.head_ref || github.ref_name}}"
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
accept-flake-config = true
experimental-features = fetch-closure flakes nix-command
substituters = https://cache.iog.io https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- name: Test
run: |
nix --version
export DEBUG="true"
export ERA_CMD="alonzo"
export MAJOR_VERSION="7"
export POOL_NAMES="sp-1 sp-2 sp-3"
export SUBMIT_TX="false"
export UNSTABLE="false"
export UNSTABLE_LIB="false"
export USE_ENCRYPTION="false"
export USE_DECRYPTION="false"
export USE_NODE_CONFIG_BP="false"
JOBS=(
"gen-custom-node-config"
"gen-custom-node-config-data"
"create-stake-pool-keys"
"move-genesis-utxo"
"register-stake-pools"
"delegate-rewards-stake-key"
"update-proposal-hard-fork"
)
RUN_TESTS() {
for i in ${JOBS[@]}; do
nix run .#job-${i}
rm -rf workbench
done
}
echo
echo "Run nix job tests with release versioning..."
RUN_TESTS
echo
echo "Now run nix job tests again with pre-release versioning..."
export UNSTABLE="true"
export UNSTABLE_LIB="true"
RUN_TESTS
1 change: 1 addition & 0 deletions flakeModules/jobs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ in {
fi
# Use the new create-testnet-data cli cmd
mkdir -p "$GENESIS_DIR"
"''${CARDANO_CLI[@]}" genesis create-testnet-data \
--genesis-keys "$NUM_GENESIS_KEYS" \
--utxo-keys 1 \
Expand Down

0 comments on commit 344913f

Please sign in to comment.