Skip to content

Commit 15e1f34

Browse files
committed
ci: binary artifact test, wip
1 parent cf906d2 commit 15e1f34

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Check binary artifact startup
2+
3+
on:
4+
pull_request:
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Install Nix
15+
uses: cachix/install-nix-action@v31
16+
with:
17+
# Use last stable nixos channel and the same nix as in channel:
18+
nix_path: nixpkgs=channel:nixos-24.11
19+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
20+
extra_nix_config: |
21+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
22+
experimental-features = nix-command flakes
23+
allow-import-from-derivation = true
24+
substituters = https://cache.nixos.org https://cache.iog.io
25+
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
26+
27+
- uses: actions/checkout@v4
28+
29+
- name: Obtain the linux binary artifact
30+
run: |
31+
nix --version
32+
33+
# TODO: Wait for hydra, or continue on light builds
34+
echo "::group::Dry-run..."
35+
nix build --accept-flake-config --dry-run .#hydraJobs.x86_64-linux.musl.cardano-node-linux
36+
echo "::group::"
37+
38+
time nix build --accept-flake-config .#hydraJobs.x86_64-linux.musl.cardano-node-linux
39+
40+
- name: Test the linux binary artifact startup
41+
run: |
42+
TIMEOUT="30"
43+
ENVS=(
44+
"mainnet"
45+
"preprod"
46+
"preview"
47+
)
48+
49+
echo "::group::Expand the artifact..."
50+
tar -zxvf result/cardano-node-*-linux.tar.gz
51+
echo "::group::"
52+
53+
for ENV in "${ENVS[@]}"; do
54+
echo "::group::Test artifact startup with $ENV for $TIMEOUT seconds"
55+
timeout "$TIMEOUT" ./bin/cardano-node run \
56+
--config "./share/$ENV/config.json" \
57+
--topology "./share/$ENV/topology.json" \
58+
--database-path "db-$ENV" \
59+
--socket-path "node-$ENV.socket"
60+
RC="$?"
61+
echo "::group::"
62+
63+
if [ "$RC" -eq 124 ]; then
64+
echo "Artifact startup for $ENV succeeded."
65+
elif [ "$RC" -eq 0 ]; then
66+
echo "Artifact startup for $ENV exited early; this is unexpected."
67+
exit 1
68+
else
69+
echo "Artifact startup for $ENV exited with error code $RC."
70+
exit 1
71+
fi
72+
done

0 commit comments

Comments
 (0)