Run Teaspoons e2e tests with BEE using GCP workspace #182
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Teaspoons e2e tests with BEE using GCP workspace | |
on: | |
schedule: | |
# run once a day at 23:25 UTC every day of the work week | |
- cron: "25 23 * * 1-5" | |
workflow_dispatch: | |
inputs: | |
custom-app-version: | |
description: 'custom image tag to specify which version of teaspoons to deploy, e.g. `0.0.81-66ceced`. defaults to dev template if not specified.' | |
required: false | |
type: string | |
e2e-test-version-ref: | |
description: 'Name of branch or commit hash in the dsp-reusable-workflows repo to use. defaults to main' | |
required: true | |
default: 'main' | |
type: string | |
wdl-method-version: | |
description: 'Name of branch or release tag in the terra-scientific-pipelines-service repo to use for the test WDL' | |
required: true | |
type: string | |
env: | |
BEE_NAME: 'teaspoons-${{ github.run_id }}-${{ github.run_attempt}}-dev' | |
TOKEN: '${{ secrets.BROADBOT_TOKEN }}' | |
RUN_NAME_SUFFIX: ${{ github.event.repository.name }}-${{ github.run_id }}-${{github.run_attempt }} | |
jobs: | |
init-github-context: | |
runs-on: ubuntu-latest | |
outputs: | |
delete-bee: '${{ steps.extract-inputs.outputs.delete-bee }}' | |
e2e-test-version-ref: '${{ steps.extract-inputs.outputs.e2e-test-version-ref }}' | |
steps: | |
- name: Get inputs or use defaults | |
id: extract-inputs | |
run: | | |
echo "delete-bee=${{ inputs.delete-bee || true }}" >> "$GITHUB_OUTPUT" | |
if [ -z ${{ inputs.custom-app-version }} ]; then | |
echo "e2e-test-version-ref={}" >> "$GITHUB_OUTPUT" | |
else | |
echo "e2e-test-version-ref={\\\"tsps\\\": {\\\"appVersion\\\":\\\"${{ inputs.custom-app-version }}\\\"} }" >> "$GITHUB_OUTPUT" | |
fi | |
params-gen: | |
runs-on: ubuntu-latest | |
outputs: | |
project-name: '${{ steps.gen.outputs.project_name }}' | |
bee-name: '${{ env.BEE_NAME }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate a random billing project name | |
id: gen | |
run: | | |
project_name=$(echo "tmp-billing-project-$(uuidgen)" | cut -c -30) | |
echo "project_name=${project_name}" >> $GITHUB_OUTPUT | |
create-bee-workflow: | |
runs-on: ubuntu-latest | |
needs: [ init-github-context ] | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Get actions | |
uses: actions/checkout@v4 | |
- name: dispatch to terra-github-workflows | |
id: FirstAttemptCreateBee | |
continue-on-error: true | |
uses: ./.github/actions/create-bee | |
with: | |
run_name: "bee-create-${{ env.BEE_NAME }}" | |
bee_name: ${{ env.BEE_NAME }} | |
token: '${{ env.TOKEN }}' | |
custom_version_json: ${{ needs.init-github-context.outputs.e2e-test-version-ref }} | |
- name: retry dispatch to terra-github-workflows in case of failure | |
if: steps.FirstAttemptCreateBee.outcome == 'failure' | |
uses: ./.github/actions/create-bee | |
with: | |
run_name: "bee-create-retry-${{ env.BEE_NAME }}" | |
bee_name: ${{ env.BEE_NAME }} | |
token: ${{ env.TOKEN }} | |
custom_version_json: ${{ needs.init-github-context.outputs.e2e-test-version-ref }} | |
run-e2e-test-job: | |
needs: | |
- create-bee-workflow | |
- params-gen | |
permissions: | |
contents: read | |
id-token: write | |
uses: broadinstitute/dsp-reusable-workflows/.github/workflows/run_tsps_e2e_tests.yaml@TSPS-280_teaspoons_e2e_gcp | |
with: | |
billing-project-name: '${{ needs.params-gen.outputs.project-name }}' | |
bee-name: '${{ needs.params-gen.outputs.bee-name }}' | |
e2e-test-version-ref: '${{ github.event.inputs.e2e-test-version-ref }}' | |
wdl-method-version: '${{ github.event.inputs.wdl-method-version }}' | |
destroy-bee-workflow: | |
runs-on: ubuntu-latest | |
needs: | |
- run-e2e-test-job | |
- init-github-context | |
if: '${{ needs.init-github-context.outputs.delete-bee && always() }}' | |
steps: | |
- name: dispatch to terra-github-workflows | |
uses: broadinstitute/workflow-dispatch@v3 | |
with: | |
workflow: bee-destroy | |
repo: broadinstitute/terra-github-workflows | |
ref: refs/heads/main | |
wait-for-completion: false | |
token: '${{ env.TOKEN }}' | |
inputs: '{ "bee-name": "${{ env.BEE_NAME }}" }' | |
report-workflow: | |
uses: broadinstitute/sherlock/.github/workflows/client-report-workflow.yaml@main | |
if: github.ref == 'refs/heads/main' | |
with: | |
notify-slack-channels-upon-workflow-completion: "#terra-tsps-alerts" | |
permissions: | |
id-token: write |