-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QA-2168: Refactor provider tests to use app version tag (semvar) (#1253)
* Refactor provider tests to use app version tag (semvar) * Add provider version to job output * Use workflow-dispatch v4.0.0 when applicable
- Loading branch information
1 parent
7e0e1da
commit 31b47ba
Showing
4 changed files
with
105 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,27 +10,27 @@ on: | |
- develop | ||
paths-ignore: ['**.md'] | ||
|
||
env: | ||
BEE_CREATE_RUN_NAME: 'bee-create-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}' | ||
BEE_DESTROY_RUN_NAME: 'bee-destroy-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}' | ||
|
||
jobs: | ||
tag: | ||
uses: ./.github/workflows/tag.yml | ||
secrets: inherit | ||
|
||
sam-build-tag-publish-job: | ||
runs-on: ubuntu-latest | ||
needs: [ tag ] | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
outputs: | ||
custom-version-json: ${{ steps.render-sam-version.outputs.custom-version-json }} | ||
tag: ${{ steps.tag.outputs.tag }} | ||
tag: ${{ needs.tag.outputs.tag }} | ||
steps: | ||
- uses: 'actions/checkout@v3' | ||
|
||
- name: Bump the tag to a new version | ||
uses: databiosphere/github-actions/actions/[email protected] | ||
id: tag | ||
env: | ||
DEFAULT_BUMP: patch | ||
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }} | ||
RELEASE_BRANCHES: develop | ||
WITH_V: true | ||
|
||
- name: debug outputs | ||
run: |- | ||
echo "github.ref ${{ github.ref }}" | ||
|
@@ -64,15 +64,15 @@ jobs: | |
repo: broadinstitute/terra-github-workflows | ||
ref: refs/heads/main | ||
token: ${{ secrets.BROADBOT_TOKEN}} # github token for access to kick off a job in the private repo | ||
inputs: '{ "repository": "${{ github.event.repository.full_name }}", "ref": "${{ steps.extract-branch.outputs.name }}", "sam-release-tag": "${{ steps.tag.outputs.tag }}" }' | ||
inputs: '{ "repository": "${{ github.event.repository.full_name }}", "ref": "${{ steps.extract-branch.outputs.name }}", "sam-release-tag": "${{ needs.tag.outputs.tag }}" }' | ||
|
||
- name: Render Sam version | ||
id: render-sam-version | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github) }} | ||
run: | | ||
echo "$GITHUB_CONTEXT" | ||
echo 'custom-version-json={\"sam\":{\"appVersion\":\"${{ steps.tag.outputs.tag }}\"}}' >> $GITHUB_OUTPUT | ||
echo 'custom-version-json={\"sam\":{\"appVersion\":\"${{ needs.tag.outputs.tag }}\"}}' >> $GITHUB_OUTPUT | ||
prepare-configs: | ||
runs-on: ubuntu-latest | ||
|
@@ -129,14 +129,20 @@ jobs: | |
echo '${{ needs.sam-build-tag-publish-job.outputs.custom-version-json }}' | ||
- name: dispatch to terra-github-workflows | ||
uses: broadinstitute/workflow-dispatch@v3 | ||
uses: broadinstitute/workflow-dispatch@v4.0.0 | ||
with: | ||
run-name: "${{ env.BEE_CREATE_RUN_NAME }}-${{ matrix.terra-env }}" | ||
workflow: bee-create | ||
repo: broadinstitute/terra-github-workflows | ||
ref: refs/heads/main | ||
token: ${{ secrets.BROADBOT_TOKEN}} # github token for access to kick off a job in the private repo | ||
# manually recalculate b/c env context is broken https://github.com/actions/runner/issues/480 | ||
inputs: '{ "bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}", "version-template": "${{ matrix.terra-env }}", "custom-version-json": "${{ needs.sam-build-tag-publish-job.outputs.custom-version-json }}" }' | ||
inputs: '{ | ||
"run-name": "${{ env.BEE_CREATE_RUN_NAME }}-${{ matrix.terra-env }}", | ||
"bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}", | ||
"version-template": "${{ matrix.terra-env }}", | ||
"custom-version-json": "${{ needs.sam-build-tag-publish-job.outputs.custom-version-json }}" | ||
}' | ||
|
||
sam-smoke-test-job: | ||
strategy: | ||
|
@@ -242,11 +248,15 @@ jobs: | |
id-token: 'write' | ||
steps: | ||
- name: dispatch to terra-github-workflows | ||
uses: broadinstitute/workflow-dispatch@v3 | ||
uses: broadinstitute/workflow-dispatch@v4.0.0 | ||
with: | ||
run-name: "${{ env.BEE_DESTROY_RUN_NAME }}-${{ matrix.terra-env }}" | ||
workflow: bee-destroy | ||
repo: broadinstitute/terra-github-workflows | ||
ref: refs/heads/main | ||
token: ${{ secrets.BROADBOT_TOKEN}} # github token for access to kick off a job in the private repo | ||
# manually recalculate b/c env context is broken https://github.com/actions/runner/issues/480 | ||
inputs: '{ "bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}" }' | ||
inputs: '{ | ||
"run-name": "${{ env.BEE_DESTROY_RUN_NAME }}-${{ matrix.terra-env }}", | ||
"bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}" | ||
}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Tag | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
print-tag: | ||
description: "Echo generated tag to console" | ||
default: "true" | ||
required: false | ||
type: string | ||
outputs: | ||
tag: | ||
description: "Generated tag" | ||
value: ${{ jobs.tag-job.outputs.tag }} | ||
secrets: | ||
BROADBOT_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
tag-job: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.tag.outputs.tag }} | ||
steps: | ||
- name: Checkout current code | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.BROADBOT_TOKEN }} # this allows the push to succeed later | ||
- name: Bump the tag to a new version | ||
# https://github.com/DataBiosphere/github-actions/tree/master/actions/bumper | ||
uses: databiosphere/github-actions/actions/[email protected] | ||
id: tag | ||
env: | ||
DEFAULT_BUMP: patch | ||
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }} | ||
RELEASE_BRANCHES: develop | ||
WITH_V: true | ||
- name: Echo generated tag to console | ||
if: ${{ inputs.print-tag == 'true' }} | ||
run: | | ||
echo "app version tag: '${{ steps.tag.outputs.tag }}'" |
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
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