11
11
If not provided the last commit on the main branch will be used instead.
12
12
required : false
13
13
type : string
14
+ docker_image_id :
15
+ description : The selected Docker image id.
16
+ required : true
17
+ type : string
18
+ default : latest
14
19
network :
20
+ description : The name of the selected Cardano network.
15
21
required : true
16
22
type : string
17
23
default : preview
18
24
aggregator_endpoint :
25
+ description : The endpoint of the selected aggregator of the Mithril network.
19
26
required : true
20
27
type : string
21
28
default : https://aggregator.pre-release-preview.api.mithril.network/aggregator
22
29
genesis_verification_key :
23
- description : The genesis verification key, if empty the "TEST_ONLY_genesis.vkey" file at the project root will be used
30
+ description : The genesis verification key location for the Mithril network.
24
31
required : false
25
32
type : string
33
+ default : https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey
26
34
enable_debug :
27
35
description : Enable debug output ("-vvv") for the mithril-client calls
28
36
required : true
29
- type : bool
37
+ type : boolean
30
38
default : false
31
39
32
40
jobs :
33
- test :
41
+ test-binaries :
34
42
strategy :
35
43
fail-fast : false
36
44
matrix :
54
62
echo "debug_level=-vvv" >> $GITHUB_OUTPUT
55
63
fi
56
64
57
- if [[ -n "${{ inputs.network }}" ]]; then
58
- echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV
59
- else
60
- echo "NETWORK=preview" >> $GITHUB_ENV
61
- fi
62
-
63
- if [[ -n "${{ inputs.aggregator_endpoint }}" ]]; then
64
- echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV
65
- else
66
- echo "AGGREGATOR_ENDPOINT=https://aggregator.pre-release-preview.api.mithril.network/aggregator" >> $GITHUB_ENV
67
- fi
68
-
69
- if [[ -n "${{ inputs.genesis_verification_key }}" ]]; then
70
- echo "GENESIS_VERIFICATION_KEY=${{ inputs.genesis_verification_key }}" >> $GITHUB_ENV
71
- else
72
- echo "GENESIS_VERIFICATION_KEY=$(cat TEST_ONLY_genesis.vkey)" >> $GITHUB_ENV
73
- fi
65
+ echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV
66
+ echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV
67
+ echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_ENV
74
68
75
69
- name : Checkout binary
76
70
uses : dawidd6/action-download-artifact@v2
@@ -108,3 +102,52 @@ jobs:
108
102
shell : bash
109
103
working-directory : ./bin
110
104
run : ./mithril-client ${{ steps.prepare.outputs.debug_level }} restore $SNAPSHOT_DIGEST
105
+
106
+ test-docker :
107
+ strategy :
108
+ fail-fast : false
109
+ matrix :
110
+ os : [ ubuntu-22.04 ]
111
+ runs-on : ${{ matrix.os }}
112
+ steps :
113
+ - name : Setup Docker
114
+ uses : docker-practice/actions-setup-docker@master
115
+ timeout-minutes : 10
116
+
117
+ - name : Prepare environment variables
118
+ id : prepare
119
+ shell : bash
120
+ run : |
121
+ if [[ "${{ inputs.enable_debug }}" == "true" ]]; then
122
+ echo "debug_level=-vvv" >> $GITHUB_OUTPUT
123
+ fi
124
+
125
+ echo "MITHRIL_IMAGE_ID=${{ inputs.docker_image_id }}" >> $GITHUB_ENV
126
+ echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV
127
+ echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV
128
+ echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_ENV
129
+
130
+ - name : Prepare Mithril client command
131
+ id : command
132
+ shell : bash
133
+ run : |
134
+ echo "mithril_client=docker run --rm -e NETWORK=$NETWORK -e GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY -e AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT --name='mithril-client' -v ~:/app/data -u $(id -u) ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID" >> $GITHUB_OUTPUT
135
+
136
+ - name : Show client version
137
+ shell : bash
138
+ run : ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} --version
139
+
140
+ - name : List and get last snapshot digest
141
+ shell : bash
142
+ run : |
143
+ ${{ steps.command.outputs.mithril_client }} list
144
+ echo "SNAPSHOT_DIGEST=$(${{ steps.command.outputs.mithril_client }} list --json | jq -r '.[0].digest')" >> $GITHUB_ENV
145
+
146
+ - name : Download Latest Snapshot
147
+ shell : bash
148
+ run : ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} download $SNAPSHOT_DIGEST
149
+
150
+ # We use the `--disable-digests-cache` option because the client is not able to create the /home/appuser/.cache directory otherwise
151
+ - name : Restore Latest Snapshot
152
+ shell : bash
153
+ run : ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} restore --disable-digests-cache $SNAPSHOT_DIGEST
0 commit comments