Skip to content

Commit 9fee61d

Browse files
committed
test: add new verification steps for cardano-db-v2 commands in Mithril Client multi-platform test
1 parent b22ba0f commit 9fee61d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/test-client.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ jobs:
100100
run: |
101101
CARDANO_TRANSACTIONS_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])')
102102
CARDANO_STAKE_DISTRIBUTION_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])')
103+
CARDANO_DATABASE_V2_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoDabase"])')
103104
echo "cardano_transactions_enabled=$CARDANO_TRANSACTIONS_CAPABILITY" >> $GITHUB_OUTPUT
104105
echo "cardano_stake_distribution_enabled=$CARDANO_STAKE_DISTRIBUTION_CAPABILITY" >> $GITHUB_OUTPUT
106+
echo "cardano_database_v2_enabled=$CARDANO_DATABASE_V2_CAPABILITY" >> $GITHUB_OUTPUT
105107
106108
- name: Assessing aggregator capabilities (Windows)
107109
id: aggregator_capability_windows
@@ -111,8 +113,10 @@ jobs:
111113
aria2c -o aggregator_capabilities.json $AGGREGATOR_ENDPOINT
112114
CARDANO_TRANSACTIONS_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])' aggregator_capabilities.json)
113115
CARDANO_STAKE_DISTRIBUTION_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])' aggregator_capabilities.json)
116+
CARDANO_DATABASE_V2_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoDatabase"])' aggregator_capabilities.json)
114117
echo "cardano_transactions_enabled=$CARDANO_TRANSACTIONS_CAPABILITY" >> $GITHUB_OUTPUT
115118
echo "cardano_stake_distribution_enabled=$CARDANO_STAKE_DISTRIBUTION_CAPABILITY" >> $GITHUB_OUTPUT
119+
echo "cardano_database_v2_enabled=$CARDANO_DATABASE_V2_CAPABILITY" >> $GITHUB_OUTPUT
116120
117121
- name: Checkout binary
118122
uses: dawidd6/action-download-artifact@v6
@@ -200,6 +204,20 @@ jobs:
200204
working-directory: ./bin
201205
run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_HASH
202206

207+
- name: Cardano Database V2 Snapshot / list and get last hash
208+
if: steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true' || steps.aggregator_capability_windows.outputs.cardano_database_v2_enabled == 'true'
209+
shell: bash
210+
working-directory: ./bin
211+
run: |
212+
./mithril-client ${{ steps.prepare.outputs.debug_level }} --unstable cardano-db-v2 snapshot list
213+
echo "CARDANO_DATABASE_V2_SNAPSHOT_HASH=$(./mithril-client --unstable cardano-db-v2 snapshot list --json | jq -r '.[0].hash')" >> $GITHUB_ENV
214+
215+
- name: Cardano Database V2 Snapshot / show snapshot
216+
if: steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true' || steps.aggregator_capability_windows.outputs.cardano_database_v2_enabled == 'true'
217+
shell: bash
218+
working-directory: ./bin
219+
run: ./mithril-client --unstable cardano-db-v2 snapshot show $CARDANO_DATABASE_V2_SNAPSHOT_HASH
220+
203221
test-docker:
204222
strategy:
205223
fail-fast: false
@@ -227,8 +245,10 @@ jobs:
227245
run: |
228246
CARDANO_TRANSACTIONS_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])')
229247
CARDANO_STAKE_DISTRIBUTION_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])')
248+
CARDANO_DATABASE_V2_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoDatabase"])')
230249
echo "cardano_transactions_enabled=$CARDANO_TRANSACTIONS_CAPABILITY" >> $GITHUB_OUTPUT
231250
echo "cardano_stake_distribution_enabled=$CARDANO_STAKE_DISTRIBUTION_CAPABILITY" >> $GITHUB_OUTPUT
251+
echo "cardano_database_v2_enabled=$CARDANO_DATABASE_V2_CAPABILITY" >> $GITHUB_OUTPUT
232252
233253
- name: Prepare Mithril client command
234254
id: command
@@ -296,6 +316,18 @@ jobs:
296316
shell: bash
297317
run: ${{ steps.command.outputs.mithril_client }} ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_HASH --download-dir /app
298318

319+
- name: Cardano Database V2 Snapshot / list and get last digest
320+
if: steps.aggregator_capability.outputs.cardano_database_v2_enabled == 'true'
321+
shell: bash
322+
run: |
323+
${{ steps.command.outputs.mithril_client }} --unstable cardano-db-v2 snapshot list
324+
echo "CARDANO_DATABASE_V2_SNAPSHOT_HASH=$(${{ steps.command.outputs.mithril_client }} cardano-db-v2 snapshot list --json | jq -r '.[0].digest')" >> $GITHUB_ENV
325+
326+
- name: Cardano Database V2 Snapshot / show snapshot
327+
if: steps.aggregator_capability.outputs.cardano_database_v2_enabled == 'true'
328+
shell: bash
329+
run: ${{ steps.command.outputs.mithril_client }} --unstable cardano-db-v2 snapshot show $CARDANO_DATABASE_V2_SNAPSHOT_HASH
330+
299331
test-mithril-client-wasm:
300332
strategy:
301333
fail-fast: false

0 commit comments

Comments
 (0)