Skip to content

Commit

Permalink
Merge branch 'develop' into ID-757-remove-sam-sync-integration-test
Browse files Browse the repository at this point in the history
  • Loading branch information
tlangs authored Feb 14, 2024
2 parents f083a54 + 0c4b377 commit b39e714
Show file tree
Hide file tree
Showing 180 changed files with 8,392 additions and 2,907 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
paths-ignore: ['**.md']
push:
branches:
- develop
paths-ignore: ['**.md']

jobs:
Expand Down Expand Up @@ -97,3 +99,19 @@ jobs:
id: publishJavaClientSnapshot
if: ${{ github.ref_name != 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=true

- name: Generate old javax java client
id: generateOldJavaClient
run: bash scripts/gen_java_client_old.sh

- name: Publish old javax java client for merge to develop branch
working-directory: codegen_java_old
id: publishOldJavaClient
if: ${{ github.ref_name == 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=false

- name: Publish old javax java client as snapshot for PRs
working-directory: codegen_java_old
id: publishOldJavaClientSnapshot
if: ${{ github.ref_name != 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=true
66 changes: 46 additions & 20 deletions .github/workflows/sam-build-tag-publish-and-run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@ 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
with:
release-branches: develop
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/bumper@bumper-0.0.6
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 }}"
Expand Down Expand Up @@ -64,15 +66,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
Expand Down Expand Up @@ -129,14 +131,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:
Expand Down Expand Up @@ -192,43 +200,57 @@ jobs:
{ group_name: workflows, tag: "-n org.broadinstitute.dsde.test.api.MethodsTest" }
] # Rawls test groups
runs-on: ubuntu-latest
needs: [sam-smoke-test-job]
needs: [sam-smoke-test-job, prepare-configs]
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: dispatch to terra-github-workflows
env:
rawls_base_test_entrypoint: "testOnly -- -l ProdTest -l NotebooksCanaryTest"
test-context: ${{ needs.prepare-configs.outputs.test-context }}
uses: broadinstitute/workflow-dispatch@v3
with:
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 }}-${{ 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\":\"\"}",
"bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ 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 }}"
}'

orch-swat-test-job:
strategy:
matrix:
terra-env: [ dev ] # what versions of apps do we use to emulate types of environments
testing-env: [ qa ] # what env resources to use, e.g. SA keys
runs-on: ubuntu-latest
needs: [sam-smoke-test-job]
needs: [ sam-smoke-test-job, prepare-configs ]
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
env:
test-context: ${{ needs.prepare-configs.outputs.test-context }}
with:
workflow: .github/workflows/orch-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 }}-${{ matrix.terra-env }}", "ENV": "${{ matrix.testing-env }}" }'
inputs: '{
"bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}",
"ENV": "${{ matrix.testing-env }}",
"test-context": "${{ env.test-context }}"
}'

destroy-bee-workflow:
strategy:
Expand All @@ -242,11 +264,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 }}"
}'
66 changes: 66 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tag
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
description: "The branch, tag or SHA to checkout"
default: ''
required: false
type: string
dry-run:
description: "Determine the next version without tagging the branch. The workflow can use the outputs new_tag and tag in subsequent steps. Possible values are true and false (default)"
default: false
required: false
type: string
print-tag:
description: "Echo generated tag to console"
default: "true"
required: false
type: string
release-branches:
description: "Default branch (main, develop, etc)"
default: 'main'
required: false
type: string
outputs:
tag:
description: "The value of the latest tag after running this action"
value: ${{ jobs.tag-job.outputs.tag }}
new-tag:
description: "The value of the newly created tag"
value: ${{ jobs.tag-job.outputs.new-tag }}
secrets:
BROADBOT_TOKEN:
required: true

jobs:
# On tag vs. new-tag.
# The new-tag is always the tag resulting from a bump to the original tag.
# However, the tag is by definition the value of the latest tag after running the action,
# which might not change if dry run is used, and remains same as the original tag.
tag-job:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
new-tag: ${{ steps.tag.outputs.new_tag }}
steps:
- name: Checkout current code
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
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/bumper@bumper-0.3.0
id: tag
env:
DEFAULT_BUMP: patch
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }}
DRY_RUN: ${{ inputs.dry-run }}
RELEASE_BRANCHES: ${{ inputs.release-branches }}
WITH_V: true
- name: Echo generated tag to console
if: ${{ inputs.print-tag == 'true' }}
run: |
echo "Newly created version tag: '${{ steps.tag.outputs.new_tag }}'"
Loading

0 comments on commit b39e714

Please sign in to comment.