Skip to content

Commit

Permalink
Merge branch 'develop' into update/scalatest-3.2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
cjllanwarne authored Dec 6, 2023
2 parents 15ea531 + 5fa4cd1 commit b10b0db
Show file tree
Hide file tree
Showing 86 changed files with 4,996 additions and 1,468 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/consumer_contract_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ on:
branches:
- develop

env:
PUBLISH_CONTRACTS_RUN_NAME: 'publish-contracts-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}'
CAN_I_DEPLOY_RUN_NAME: 'can-i-deploy-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}'

jobs:
init-github-context:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,7 +96,7 @@ jobs:
rawls-consumer-contract-tests:
runs-on: ubuntu-latest
needs: [init-github-context]
needs: [ init-github-context ]
outputs:
pact-b64: ${{ steps.encode-pact.outputs.pact-b64 }}

Expand All @@ -111,35 +115,51 @@ jobs:
id: encode-pact
run: |
cd pact4s
NON_BREAKING_B64=$(cat target/pacts/rawls-consumer-bpm-provider.json | base64 -w 0)
NON_BREAKING_B64=$(cat target/pacts/rawls-bpm.json | base64 -w 0)
echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT
# Prevent untrusted sources from using PRs to publish contracts
# since access to secrets is not allowed.
publish-contracts:
runs-on: ubuntu-latest
if: ${{ needs.init-github-context.outputs.fork == 'false' }}
needs: [init-github-context, rawls-consumer-contract-tests]
needs:
- init-github-context
- rawls-consumer-contract-tests
steps:
- name: Dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
uses: broadinstitute/workflow-dispatch@v4.0.0
with:
run-name: "${{ env.PUBLISH_CONTRACTS_RUN_NAME }}"
workflow: .github/workflows/publish-contracts.yaml
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: '{ "pact-b64": "${{ needs.rawls-consumer-contract-tests.outputs.pact-b64 }}", "repo-owner": "${{ github.repository_owner }}", "repo-name": "${{ github.event.repository.name }}", "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}" }'
inputs: '{
"run-name": "${{ env.PUBLISH_CONTRACTS_RUN_NAME }}",
"pact-b64": "${{ needs.rawls-consumer-contract-tests.outputs.pact-b64 }}",
"repo-owner": "${{ github.repository_owner }}",
"repo-name": "${{ github.event.repository.name }}",
"repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}"
}'

can-i-deploy:
runs-on: ubuntu-latest
if: ${{ needs.init-github-context.outputs.fork == 'false' }}
needs: [ init-github-context, publish-contracts ]
needs:
- init-github-context
- publish-contracts
steps:
- name: Dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
uses: broadinstitute/workflow-dispatch@v4.0.0
with:
run-name: "${{ env.CAN_I_DEPLOY_RUN_NAME }}"
workflow: .github/workflows/can-i-deploy.yaml
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: '{ "pacticipant": "rawls-consumer", "version": "${{ needs.init-github-context.outputs.repo-version }}" }'
inputs: '{
"run-name": "${{ env.CAN_I_DEPLOY_RUN_NAME }}",
"pacticipant": "rawls",
"version": "${{ needs.init-github-context.outputs.repo-version }}"
}'
75 changes: 64 additions & 11 deletions .github/workflows/rawls-build-tag-publish-and-run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- develop
paths-ignore: ['**.md']

env:
RAWLS_BUILD_RUN_NAME: 'rawls-build-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}'
RAWLS_SWAT_TESTS_RUN_NAME: 'rawls-swat-tests-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}'
BEE_NAME: '${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt}}'
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:
rawls-build-tag-publish-job:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,13 +54,19 @@ jobs:
echo "name=$GITHUB_SHA" >> $GITHUB_OUTPUT
- name: dispatch build to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
uses: broadinstitute/workflow-dispatch@v4.0.0
with:
run-name: "${{ env.RAWLS_BUILD_RUN_NAME }}"
workflow: rawls-build
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.ref }}", "rawls-release-tag": "${{ steps.tag.outputs.tag }}" }'
inputs: '{
"run-name": "${{ env.RAWLS_BUILD_RUN_NAME }}",
"repository": "${{ github.event.repository.full_name }}",
"ref": "${{ steps.extract-branch.outputs.ref }}",
"rawls-release-tag": "${{ steps.tag.outputs.tag }}"
}'

- name: Render Rawls version
id: render-rawls-version
Expand All @@ -63,12 +76,29 @@ jobs:
echo "$GITHUB_CONTEXT"
echo "custom-version-json={\\\"rawls\\\":{\\\"appVersion\\\":\\\"${{ steps.tag.outputs.tag }}\\\"}}" >> $GITHUB_OUTPUT
init-github-context:
runs-on: ubuntu-latest
outputs:
log-results: ${{ steps.set-test-context.outputs.log-results }}
test-context: ${{ steps.set-test-context.outputs.test-context }}
steps:
- name: Get test context
id: set-test-context
run: |-
echo 'log-results=true' >> $GITHUB_OUTPUT
if ${{ github.ref_name == 'develop' }}; then
echo 'test-context=dev-merge' >> $GITHUB_OUTPUT
else
echo 'test-context=pr-test' >> $GITHUB_OUTPUT
fi
create-bee-workflow:
strategy:
matrix:
terra-env: [ dev ] # what versions of apps do we use to emulate types of environments
runs-on: ubuntu-latest
needs: [rawls-build-tag-publish-job]
needs:
- rawls-build-tag-publish-job
permissions:
contents: 'read'
id-token: 'write'
Expand All @@ -78,14 +108,20 @@ jobs:
echo '${{ needs.rawls-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 }}-${{ github.run_attempt}}-${{ matrix.terra-env }}", "version-template": "${{ matrix.terra-env }}", "custom-version-json": "${{ needs.rawls-build-tag-publish-job.outputs.custom-version-json }}" }'
inputs: '{
"run-name": "${{ env.BEE_CREATE_RUN_NAME }}-${{ matrix.terra-env }}",
"bee-name": "${{ env.BEE_NAME }}-${{ matrix.terra-env }}",
"version-template": "${{ matrix.terra-env }}",
"custom-version-json": "${{ needs.rawls-build-tag-publish-job.outputs.custom-version-json }}"
}'

rawls-swat-test-job:
strategy:
Expand All @@ -98,40 +134,57 @@ jobs:
{ group_name: workflows, tag: "-n org.broadinstitute.dsde.test.api.MethodsTest" }
] # Rawls test groups
runs-on: ubuntu-latest
needs: [create-bee-workflow]
needs:
- create-bee-workflow
- init-github-context
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: dispatch to terra-github-workflows
env:
rawls_base_test_entrypoint: "testOnly -- -l ProdTest -l NotebooksCanaryTest"
uses: broadinstitute/workflow-dispatch@v3
test-context: ${{ needs.init-github-context.outputs.test-context }}
uses: broadinstitute/[email protected]
with:
run-name: "${{ env.RAWLS_SWAT_TESTS_RUN_NAME }}-${{ matrix.terra-env }}-${{ matrix.testing-env }}-${{ matrix.test-group.group_name }}"
workflow: .github/workflows/rawls-swat-tests.yaml
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 }}-${{ github.run_attempt}}-${{ matrix.terra-env }}", "ENV": "${{ matrix.testing-env }}", "test-group-name": "${{ matrix.test-group.group_name }}", "test-command": "${{ env.rawls_base_test_entrypoint }} ${{ matrix.test-group.tag }}", "java-version": "17" }'
inputs: '{
"additional-args": "{\"logging\":\"true\",\"java-version\":\"17\",\"billing-project\":\"\"}",
"run-name": "${{ env.RAWLS_SWAT_TESTS_RUN_NAME }}-${{ matrix.terra-env }}-${{ matrix.testing-env }}-${{ matrix.test-group.group_name }}",
"bee-name": "${{ env.BEE_NAME }}-${{ matrix.terra-env }}",
"ENV": "${{ matrix.testing-env }}",
"test-group-name": "${{ matrix.test-group.group_name }}",
"test-command": "${{ env.rawls_base_test_entrypoint }} ${{ matrix.test-group.tag }}",
"test-context": "${{ env.test-context }}"
}'

destroy-bee-workflow:
strategy:
matrix:
terra-env: [ dev ] # what versions of apps do we use to emulate types of environments
runs-on: ubuntu-latest
needs: [rawls-swat-test-job]
needs:
- rawls-swat-test-job
if: always() # always run to confirm bee is destroyed
permissions:
contents: 'read'
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 }}-${{ github.run_attempt}}-${{ matrix.terra-env }}" }'
inputs: '{
"run-name": "${{ env.BEE_DESTROY_RUN_NAME }}-${{ matrix.terra-env }}",
"bee-name": "${{ env.BEE_NAME }}-${{ matrix.terra-env }}"
}'
Loading

0 comments on commit b10b0db

Please sign in to comment.