Skip to content

Commit

Permalink
GH Test action: allow specifying docker image tags to e2e test with a…
Browse files Browse the repository at this point in the history
…s GH action inputs
  • Loading branch information
dandelany committed Nov 20, 2024
1 parent 5b91430 commit 52fc887
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ on:
tags:
- v*
workflow_dispatch:
inputs:
aerie_image_tag:
description: 'Docker image tag of backend aerie images to run e2e tests against'
type: string
required: false
gateway_image_tag:
description: 'Docker image tag of aerie-gateway image to run e2e tests against'
type: string
required: false
workflow_call:
inputs:
env:
Expand Down Expand Up @@ -79,12 +88,20 @@ jobs:
if: ${{ contains(env.PR_BODY, '___REQUIRES_AERIE_PR___=') }}
run: |
echo "AERIE_IMAGE_TAG=pr-$(echo $PR_BODY | sed -n 's/.*___REQUIRES_AERIE_PR___=\"\([0-9]\+\)\".*/\1/p')" >> $GITHUB_ENV
- name: Extract Aerie backend docker tag from inputs
# if user specifies aerie docker image tag manually via GH action input, use this instead
if: "${{ inputs.aerie_image_tag != '' }}"
run: echo "AERIE_IMAGE_TAG=${{ inputs.aerie_image_tag }}" >> $GITHUB_ENV
- name: Extract Aerie gateway docker tag from PR body
# look in the PR body for eg. the string ___REQUIRES_AERIE_PR___=9999, extract the number & save to env var
# if backend PR is labeled correctly, it will publish a docker tag called 'pr-9999' to use in tests
if: ${{ contains(env.PR_BODY, '___REQUIRES_GATEWAY_PR___=') }}
run: |
echo "GATEWAY_IMAGE_TAG=pr-$(echo $PR_BODY | sed -n 's/.*___REQUIRES_GATEWAY_PR___=\"\([0-9]\+\)\".*/\1/p')" >> $GITHUB_ENV
- name: Extract Aerie gateway docker tag from inputs
# if user specifies gateway docker image tag manually via GH action input, use this instead
if: "${{ inputs.gateway_image_tag != '' }}"
run: echo "GATEWAY_IMAGE_TAG=${{ inputs.gateway_image_tag }}" >> $GITHUB_ENV
- name: Start Services (Aerie)
run: |
echo "AERIE_IMAGE_TAG: $AERIE_IMAGE_TAG"
Expand Down

0 comments on commit 52fc887

Please sign in to comment.