-
Notifications
You must be signed in to change notification settings - Fork 87
76 lines (68 loc) · 2.34 KB
/
smoke-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "Smoke test"
on:
workflow_dispatch:
inputs:
network:
description: "Cardano network to run against"
required: true
default: "preview"
type: choice
options:
- preview
- preprod
- mainnet
- sanchonet
hydra-scripts-tx-id:
description: "TxId of already published scripts (leave empty to publish)"
required: false
use-mithril:
description: "Bootstrap cardano-node using mithril (removes existing db/)"
required: false
type: boolean
jobs:
smoke-test:
name: "Smoke test on ${{inputs.network}}"
runs-on: [self-hosted, cardano]
concurrency: cardano-${{inputs.network}}
env:
state_dir: /srv/var/cardano/state-${{inputs.network}}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: ❄ Prepare nix
uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
accept-flake-config = true
- name: 🧹 Cleanup hydra-node state
run: |
rm -rf ${state_dir}/state-*
- name: 🤐 Setup secret faucet key
if: ${{ inputs.network == 'mainnet' }}
run: |
echo "${{secrets.faucet_sk}}" | base64 -d >hydra-cluster/config/credentials/faucet.sk
echo "${{secrets.faucet_vk}}" | base64 -d >hydra-cluster/config/credentials/faucet.vk
- name: 🚬 Run hydra-cluster smoke test
run: |
if [ -n "${{inputs.hydra-scripts-tx-id}}" ]; then
HYDRA_SCRIPTS_ARG="--hydra-scripts-tx-id ${{inputs.hydra-scripts-tx-id}}"
else
HYDRA_SCRIPTS_ARG="--publish-hydra-scripts"
fi
if ${{inputs.use-mithril}}; then
USE_MITHRIL_ARG="--use-mithril"
fi
# In case we run against an already running node, fix the permissions of
# the host-mounted node.socket file (which would be owned by root)
if [ -e ${state_dir}/node.socket ]; then
sudo chmod a+w ${state_dir}/node.socket
fi
nix develop .#exes --command bash -c "hydra-cluster --${{inputs.network}} --state-directory ${state_dir} ${HYDRA_SCRIPTS_ARG} ${USE_MITHRIL_ARG}"
- name: 💾 Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: hydra-cluster-logs
path: ${state_dir}/logs/**/*
if-no-files-found: ignore