Skip to content

Commit

Permalink
test: add new verification step in Mithril Client multi-platform test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlachaume committed Aug 8, 2024
1 parent c3519bc commit 44dc188
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ jobs:
shell: bash
run: |
CTX_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])')
CSD_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])')
echo "ctx_enabled=$CTX_CAPABILITY" >> $GITHUB_OUTPUT
echo "csd_enabled=$CSD_CAPABILITY" >> $GITHUB_OUTPUT
- name: Assessing aggregator capabilities (Windows)
id: aggregator_capability_windows
Expand All @@ -86,7 +88,9 @@ jobs:
run: |
aria2c -o aggregator_capabilities.json $AGGREGATOR_ENDPOINT
CTX_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])' aggregator_capabilities.json)
CSD_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])' aggregator_capabilities.json)
echo "ctx_enabled=$CTX_CAPABILITY" >> $GITHUB_OUTPUT
echo "csd_enabled=$CSD_CAPABILITY" >> $GITHUB_OUTPUT
- name: Checkout binary
uses: dawidd6/action-download-artifact@v3
Expand Down Expand Up @@ -152,6 +156,28 @@ jobs:
working-directory: ./bin
run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-transaction certify $TRANSACTIONS_HASHES_TO_CERTIFY

- name: Cardano Stake Distribution / list and get last epoch and hash
if: steps.aggregator_capability_unix.outputs.csd_enabled == 'true' || steps.aggregator_capability_windows.outputs.csd_enabled == 'true'
shell: bash
working-directory: ./bin
run: |
./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution list
CMD_OUTPUT=$(./mithril-client --unstable cardano-stake-distribution list --json)
echo "CARDANO_STAKE_DISTRIBUTION_EPOCH=$(echo "$CMD_OUTPUT" | jq -r '.[0].epoch')" >> $GITHUB_ENV
echo "CARDANO_STAKE_DISTRIBUTION_HASH=$(echo "$CMD_OUTPUT" | jq -r '.[0].hash')" >> $GITHUB_ENV
- name: Cardano Stake Distribution / download & restore latest by epoch
if: steps.aggregator_capability_unix.outputs.csd_enabled == 'true' || steps.aggregator_capability_windows.outputs.csd_enabled == 'true'
shell: bash
working-directory: ./bin
run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_EPOCH

- name: Cardano Stake Distribution / download & restore latest by hash
if: steps.aggregator_capability_unix.outputs.csd_enabled == 'true' || steps.aggregator_capability_windows.outputs.csd_enabled == 'true'
shell: bash
working-directory: ./bin
run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_HASH

test-docker:
strategy:
fail-fast: false
Expand All @@ -178,7 +204,9 @@ jobs:
shell: bash
run: |
CTX_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])')
CSD_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoStakeDistribution"])')
echo "ctx_enabled=$CTX_CAPABILITY" >> $GITHUB_OUTPUT
echo "csd_enabled=$CSD_CAPABILITY" >> $GITHUB_OUTPUT
- name: Prepare Mithril client command
id: command
Expand Down Expand Up @@ -227,6 +255,25 @@ jobs:
shell: bash
run: ${{ steps.command.outputs.mithril_client }} --unstable ${{ steps.prepare.outputs.debug_level }} cardano-transaction certify $TRANSACTIONS_HASHES_TO_CERTIFY

- name: Cardano Stake Distribution / list and get last epoch and hash
if: steps.aggregator_capability.outputs.csd_enabled == 'true'
shell: bash
run: |
${{ steps.command.outputs.mithril_client }} --unstable cardano-stake-distribution list
CMD_OUTPUT=$(${{ steps.command.outputs.mithril_client }} cardano-stake-distribution list --json)
echo "CARDANO_STAKE_DISTRIBUTION_EPOCH=$(echo "$CMD_OUTPUT" | jq -r '.[0].epoch')" >> $GITHUB_ENV
echo "CARDANO_STAKE_DISTRIBUTION_HASH=$(echo "$CMD_OUTPUT" | jq -r '.[0].hash')" >> $GITHUB_ENV
- name: Cardano Stake Distribution / download & restore latest by epoch
if: steps.aggregator_capability.outputs.csd_enabled == 'true'
shell: bash
run: ${{ steps.command.outputs.mithril_client }} --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_EPOCH --download-dir /app

- name: Cardano Stake Distribution / download & restore latest by hash
if: steps.aggregator_capability.outputs.csd_enabled == 'true'
shell: bash
run: ${{ steps.command.outputs.mithril_client }} --unstable ${{ steps.prepare.outputs.debug_level }} cardano-stake-distribution download $CARDANO_STAKE_DISTRIBUTION_HASH --download-dir /app

test-mithril-client-wasm:
strategy:
fail-fast: false
Expand Down

0 comments on commit 44dc188

Please sign in to comment.