From ca99de564032d5ae78c80280f69d173a2d6da78e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 2 Jan 2025 15:03:20 +0100 Subject: [PATCH] fix: 'Mithril Client multi-platform test' workflow env variables --- .github/workflows/test-client.yml | 47 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index 444dbe13d6..7d27d5d99b 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -43,6 +43,24 @@ on: default: false jobs: + prepare: + runs-on: ubuntu-22.04 + steps: + - name: Prepare environment variables + id: prepare + shell: bash + run: | + if [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "NETWORK=preview" >> $GITHUB_ENV + echo "AGGREGATOR_ENDPOINT=https://aggregator.testing-preview.api.mithril.network/aggregator" >> $GITHUB_ENV + echo "GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-preview/genesis.vkey)" >> $GITHUB_ENV + echo "TRANSACTIONS_HASHES_TO_CERTIFY=1f7dbc899a898ceb4274bbc33b31ca5f0de497753c6c6795fa34838fc252de9b,c43e809de628f7c1ba41a44f188ed3872bb1f97aa101271e35424a8e1d95bea9,c61e22ac4a79a02b28ed36217369ff6959465790a4fe9e66738b7a820e174fcd" >> $GITHUB_ENV + else + 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 + fi test-binaries: strategy: fail-fast: false @@ -67,18 +85,6 @@ jobs: echo "debug_level=-vvv" >> $GITHUB_OUTPUT fi - if [[ "${{ github.event_name }}" == "schedule" ]]; then - echo "NETWORK=preview" >> $GITHUB_ENV - echo "AGGREGATOR_ENDPOINT=https://aggregator.testing-preview.api.mithril.network/aggregator" >> $GITHUB_ENV - echo "GENESIS_VERIFICATION_KEY=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-preview/genesis.vkey)" >> $GITHUB_ENV - echo "TRANSACTIONS_HASHES_TO_CERTIFY=1f7dbc899a898ceb4274bbc33b31ca5f0de497753c6c6795fa34838fc252de9b,c43e809de628f7c1ba41a44f188ed3872bb1f97aa101271e35424a8e1d95bea9,c61e22ac4a79a02b28ed36217369ff6959465790a4fe9e66738b7a820e174fcd" >> $GITHUB_ENV - else - 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 - fi - - name: Assessing aggregator capabilities (Unix) id: aggregator_capability_unix if: runner.os != 'Windows' @@ -201,11 +207,11 @@ jobs: echo "debug_level=-vvv" >> $GITHUB_OUTPUT fi - echo "MITHRIL_IMAGE_ID=${{ inputs.docker_image_id }}" >> $GITHUB_ENV - 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 + if [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "MITHRIL_IMAGE_ID=latest" >> $GITHUB_ENV + else + echo "MITHRIL_IMAGE_ID=${{ inputs.docker_image_id }}" >> $GITHUB_ENV + fi - name: Assessing aggregator capabilities id: aggregator_capability @@ -310,13 +316,6 @@ jobs: working-directory: mithril-client-wasm run: make ci-test-install - - name: Create .env file - working-directory: mithril-client-wasm - run: | - echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" > ./ci-test/.env - echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> ./ci-test/.env - echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ inputs.transactions_hashes_to_certify }}" >> ./ci-test/.env - - name: Start the server working-directory: mithril-client-wasm shell: bash