Merge pull request #2601 from ZcashFoundation/dconnolly-patch-1
Sync to, not past, activation for regenerate-stateful-test-disks.yml
This commit is contained in:
parent
94175c6955
commit
21d71a651e
|
@ -2,6 +2,9 @@ name: Regenerate test state
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
network:
|
||||||
|
default: 'mainnet'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PROJECT_ID: zealous-zebra
|
PROJECT_ID: zealous-zebra
|
||||||
|
@ -48,29 +51,33 @@ jobs:
|
||||||
--boot-disk-size 100GB \
|
--boot-disk-size 100GB \
|
||||||
--boot-disk-type pd-ssd \
|
--boot-disk-type pd-ssd \
|
||||||
--container-image rust:buster \
|
--container-image rust:buster \
|
||||||
--container-mount-disk mount-path='/mainnet',name="zebrad-cache-$SHORT_SHA-mainnet-1046400" \
|
--container-mount-disk mount-path='/${{ github.event.inputs.network }}',name="zebrad-cache-$SHORT_SHA-${{ github.event.inputs.network }}-canopy" \
|
||||||
--container-mount-disk mount-path='/testnet',name="zebrad-cache-$SHORT_SHA-testnet-1028500" \
|
|
||||||
--container-restart-policy never \
|
--container-restart-policy never \
|
||||||
--create-disk name="zebrad-cache-$SHORT_SHA-mainnet-1046400",size=100GB,type=pd-balanced,auto-delete=no \
|
--create-disk name="zebrad-cache-$SHORT_SHA-${{ github.event.inputs.network }}-canopy",size=100GB,type=pd-balanced \
|
||||||
--create-disk name="zebrad-cache-$SHORT_SHA-testnet-1028500",size=100GB,type=pd-balanced,auto-delete=no \
|
|
||||||
--machine-type n2-standard-4 \
|
--machine-type n2-standard-4 \
|
||||||
--service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \
|
--service-account cos-vm@zealous-zebra.iam.gserviceaccount.com \
|
||||||
--scopes cloud-platform \
|
--scopes cloud-platform \
|
||||||
--tags zebrad \
|
--tags zebrad \
|
||||||
--zone "$ZONE"
|
--zone "$ZONE"
|
||||||
# Build and run test container to sync up to activation and no further, for mainnet and then testnet
|
# Build and run test container to sync up to activation and no further
|
||||||
- name: Run all tests
|
- name: Regenerate state for tests
|
||||||
|
id: regenerate-state
|
||||||
run: |
|
run: |
|
||||||
gcloud compute ssh "zebrad-tests-$BRANCH_NAME-$SHORT_SHA" --zone "$ZONE" --command \
|
gcloud compute ssh "zebrad-tests-$BRANCH_NAME-$SHORT_SHA" --zone "$ZONE" --command \
|
||||||
"git clone -b $BRANCH_NAME https://github.com/ZcashFoundation/zebra.git &&
|
"git clone -b $BRANCH_NAME https://github.com/ZcashFoundation/zebra.git &&
|
||||||
cd zebra/ &&
|
cd zebra/ &&
|
||||||
docker build --build-arg SHORT_SHA=$SHORT_SHA -f docker/Dockerfile.test -t zebrad-test . &&
|
docker build --build-arg SHORT_SHA=$SHORT_SHA -f docker/Dockerfile.test -t zebrad-test . &&
|
||||||
docker run -i -e "ZEBRA_SKIP_IPV6_TESTS=1" --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-mainnet-1046400,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_mandatory_checkpoint_mainnet --manifest-path zebrad/Cargo.toml sync_past_mandatory_checkpoint_mainnet &&
|
docker run -i -e "ZEBRA_SKIP_IPV6_TESTS=1" --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-${{ github.event.inputs.network }}-canopy,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_to_mandatory_checkpoint_${{ github.event.inputs.network }} --manifest-path zebrad/Cargo.toml sync_to_mandatory_checkpoint_${{ github.event.inputs.network }};
|
||||||
docker run -i -e "ZEBRA_SKIP_IPV6_TESTS=1" --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-testnet-1028500,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_mandatory_checkpoint_testnet --manifest-path zebrad/Cargo.toml sync_past_mandatory_checkpoint_testnet;
|
|
||||||
"
|
"
|
||||||
|
# Create image from disk that will be used in test.yml workflow
|
||||||
|
- name: Create image from state disk
|
||||||
|
# Only run if the earlier step succeeds
|
||||||
|
if: steps.regenerate-state.outcome == 'success'
|
||||||
|
run: |
|
||||||
|
gcloud compute images create "zebrad-cache-$SHORT_SHA-${{ github.event.inputs.network }}-canopy" --source-disk="zebrad-cache-$SHORT_SHA-${{ github.event.inputs.network }}-canopy" --source-disk-zone="$ZONE"
|
||||||
# Clean up
|
# Clean up
|
||||||
- name: Delete test instance
|
- name: Delete test instance
|
||||||
# Always run even if the earlier step fails
|
# Always run even if the earlier step fails
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
gcloud compute instances delete "zebrad-tests-$BRANCH_NAME-$SHORT_SHA" --delete-disks boot --zone "$ZONE"
|
gcloud compute instances delete "zebrad-tests-$BRANCH_NAME-$SHORT_SHA" --delete-disks all --zone "$ZONE"
|
||||||
|
|
Loading…
Reference in New Issue