From 2b2907dae2e54432fcfff859b22ccf9cf59b8b01 Mon Sep 17 00:00:00 2001 From: Damien LACHAUME / PALO-IT Date: Wed, 21 Feb 2024 19:25:12 +0100 Subject: [PATCH] test: add test depending on aggregator capabilities in `test-client.yml` --- .github/workflows/test-client.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index 260885b983f..826d997cf87 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -48,6 +48,8 @@ jobs: matrix: os: [ ubuntu-22.04, macos-12, windows-latest ] runs-on: ${{ matrix.os }} + env: + CTX_AGGREGATOR_CAPABILITY: false steps: - name: Checkout sources uses: actions/checkout@v3 @@ -69,6 +71,24 @@ jobs: echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_ENV + echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ inputs.transactions_hashes_to_certify }}" >> $GITHUB_ENV + + - name: Prepare environment variable for Cardano transactions aggregator capability (ubuntu-22.04, macos-12) + id: aggregator_capability_unix + if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12' + shell: bash + run: | + CTX_AGGREGATOR_CAPABILITY=$(wget -q -O - $AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])') + echo "ctx_enabled=$(echo $CTX_AGGREGATOR_CAPABILITY | cut -c1-7)" >> $GITHUB_OUTPUT + + - name: Prepare environment variable for Cardano transactions aggregator capability (windows-latest) + id: aggregator_capability_windows + if: matrix.os == 'windows-latest' + shell: bash + run: | + aria2c -o aggregator_capabilities.json $AGGREGATOR_ENDPOINT + CTX_AGGREGATOR_CAPABILITY=$(jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])' aggregator_capabilities.json) + echo "ctx_enabled=$(echo $CTX_AGGREGATOR_CAPABILITY | cut -c1-7)" >> $GITHUB_OUTPUT - name: Checkout binary uses: dawidd6/action-download-artifact@v2 @@ -114,6 +134,12 @@ jobs: working-directory: ./bin run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} mithril-stake-distribution download $MITHRIL_STAKE_DISTRIBUTION_HASH + - name: Cardano transaction certify + if: ${{ steps.aggregator_capability_unix.outputs.ctx_enabled }} == 'true' || ${{ steps.aggregator_capability_windows.outputs.ctx_enabled }} == 'true' || + shell: bash + working-directory: ./bin + run: ./mithril-client --unstable ${{ steps.prepare.outputs.debug_level }} cardano-transaction certify $TRANSACTIONS_HASHES_TO_CERTIFY + test-docker: strategy: fail-fast: false @@ -125,7 +151,7 @@ jobs: id: prepare shell: bash run: | - if [[ "${{ inputs.enable_debug }}" == "true" ]]; then + if [[ "${{ inputs.enable_debug }}" == true ]]; then echo "debug_level=-vvv" >> $GITHUB_OUTPUT fi