Skip to content

Commit

Permalink
imp(test): segregate variables from action
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavovalverde committed Feb 14, 2022
1 parent 8498d02 commit 06260aa
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ jobs:
--tags zebrad \
--zone "${{ env.ZONE }}"
- name: Regenerate stateful disks
id: sync-to-checkpoint
- name: Get container name from logs
id: get-container-name
if: steps.create-instance.outcome == 'success'
run: |
INSTANCE_ID=$(gcloud compute instances describe zebrad-tests-${{ env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}-${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT || env.GITHUB_SHA_SHORT }} --zone ${{ env.ZONE }} --format='value(id)')
Expand All @@ -234,12 +234,20 @@ jobs:
echo "Using container: ${CONTAINER_NAME}"
done
CONTAINER_NAME=$(gcloud logging read 'logName=projects/${{ env.PROJECT_ID }}/logs/cos_containers AND jsonPayload."cos.googleapis.com/container_name":zebrad-tests-${{ env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}-${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT || env.GITHUB_SHA_SHORT }}' --format="value(jsonPayload.'cos.googleapis.com/container_name')" --limit=1)
echo "::set-output name=zebra_container::$CONTAINER_NAME"
- name: Regenerate stateful disks
id: sync-to-checkpoint
if: steps.create-instance.outcome == 'success'
run: |
gcloud compute ssh \
zebrad-tests-${{ env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}-${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT || env.GITHUB_SHA_SHORT }} \
--zone ${{ env.ZONE }} \
--quiet \
--container=${CONTAINER_NAME} \
--container=${{ env.ZEBRA_CONTAINER }} \
--command="cargo test --locked --release --verbose --features enable-sentry,test_sync_past_mandatory_checkpoint_${{ env.lower_net_name }} --manifest-path zebrad/Cargo.toml sync_past_mandatory_checkpoint_${{ env.lower_net_name }}"
env:
ZEBRA_CONTAINER: ${{ steps.get-container-name.outputs.zebra_container }}

# Create image from disk that will be used to sync past mandatory checkpoint test
- name: Create image from state disk
Expand Down

0 comments on commit 06260aa

Please sign in to comment.