From abef3842ce8bf3c7d7bd68c3b329ceab4b393dde Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 25 May 2022 11:39:03 -0400 Subject: [PATCH] fix(ci): mount the lwd-cache dir to the `lightwalletd-full-sync` (#4486) * fix(ci): allow for the lightwalletd-full-sync to mount the lwd-cache dir * fix(ci): compare with a string * imp(ci): run a lightwalletd tip if there's no lwd tip disk available * docs(ci): add TODO explaining this is a temporal condition --- .github/workflows/continous-integration-docker.yml | 8 ++++++-- .github/workflows/deploy-gcp-tests.yml | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continous-integration-docker.yml b/.github/workflows/continous-integration-docker.yml index dde1aad7e..0bc9ac71e 100644 --- a/.github/workflows/continous-integration-docker.yml +++ b/.github/workflows/continous-integration-docker.yml @@ -372,9 +372,13 @@ jobs: # Otherwise, if the state rebuild was skipped, runs immediately after the build job. lightwalletd-full-sync: name: lightwalletd tip - needs: test-full-sync + needs: [ test-full-sync, get-available-disks ] uses: ./.github/workflows/deploy-gcp-tests.yml - if: ${{ !cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' }} + # to also run on Mergify head branches, + # add `|| (github.event_name == 'push' && startsWith(github.head_ref, 'mergify/merge-queue/'))`: + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1 + # TODO: this test is unreliable, in the meanwhile we'll only generate a new lwd cached state when a full sync is also triggered + if: ${{ (!cancelled() && !failure() && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true') || !fromJSON(needs.get-available-disks.outputs.lwd_tip_disk) }} with: app_name: lightwalletd test_id: lwd-full-sync diff --git a/.github/workflows/deploy-gcp-tests.yml b/.github/workflows/deploy-gcp-tests.yml index db2e4af31..2c709f0a5 100644 --- a/.github/workflows/deploy-gcp-tests.yml +++ b/.github/workflows/deploy-gcp-tests.yml @@ -297,7 +297,10 @@ jobs: - name: Run ${{ inputs.test_id }} test # This step mounts the volume only when a single cached state is needed, in this case # the cached state from Zebra. - if: ${{ inputs.needs_zebra_state && !inputs.needs_lwd_state }} + # lightwalletd-full-sync test is an exception to this rule, as it does not need a lwd cached state, + # but it does saves a lwd cached state + # TODO: we should find a better logic for this use cases + if: ${{ (inputs.needs_zebra_state && !inputs.needs_lwd_state) && inputs.test_id != 'lwd-full-sync' }} run: | gcloud compute ssh \ ${{ inputs.test_id }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \ @@ -340,7 +343,10 @@ jobs: - name: Run ${{ inputs.test_id }} test # This step mounts the volume only when both cached states are needed, in this case # the cached state from Zebra and Lightwalletd - if: ${{ inputs.needs_zebra_state && inputs.needs_lwd_state }} + # lightwalletd-full-sync test is an exception to this rule, as it does not need a lwd cached state, + # but it does saves a lwd cached state + # TODO: we should find a better logic for this use cases + if: ${{ (inputs.needs_zebra_state && inputs.needs_lwd_state) || inputs.test_id == 'lwd-full-sync' }} run: | gcloud compute ssh \ ${{ inputs.test_id }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \