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
This commit is contained in:
Gustavo Valverde 2022-05-25 11:39:03 -04:00 committed by GitHub
parent 97b9911c7d
commit abef3842ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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 }} \