From 03894a95eb290339777d9a4d213a732d6293b32a 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 | 50 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index 444dbe13d6..a09b9b4b51 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -43,12 +43,31 @@ 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 matrix: os: [ubuntu-22.04, macos-14, macos-14-large, windows-latest] runs-on: ${{ matrix.os }} + needs: [prepare] steps: - name: Checkout sources uses: actions/checkout@v4 @@ -67,18 +86,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' @@ -192,6 +199,7 @@ jobs: matrix: os: [ubuntu-22.04] runs-on: ${{ matrix.os }} + needs: [prepare] steps: - name: Prepare environment variables id: prepare @@ -201,11 +209,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 @@ -288,6 +296,7 @@ jobs: matrix: os: [ubuntu-22.04] runs-on: ${{ matrix.os }} + needs: [prepare] steps: - name: Checkout sources uses: actions/checkout@v4 @@ -310,13 +319,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