Skip to content

Commit

Permalink
inlcude site report in release
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Kinard <[email protected]>
  • Loading branch information
Polber committed Aug 8, 2024
1 parent 6258de4 commit 07d71ba
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 271 deletions.
222 changes: 62 additions & 160 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ permissions:
contents: write

jobs:
create_release_branch:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_branch_name: ${{ steps.variables.outputs.release_branch_name }}
tag_name: ${{ steps.variables.outputs.tag_name }}
runs-on: [self-hosted, release]
steps:
- name: Get releaser identity
run: |
Expand All @@ -35,8 +32,8 @@ jobs:
- name: Declare release branch name and tag name
id: variables
run: |
echo "release_branch_name=release_${CANDIDATE_NAME,,}" >> $GITHUB_OUTPUT
echo "tag_name=${CANDIDATE_NAME^^}" >> $GITHUB_OUTPUT
echo "releaseBranchName=release_${CANDIDATE_NAME,,}" >> $GITHUB_OUTPUT
echo "tagName=${CANDIDATE_NAME^^}" >> $GITHUB_OUTPUT
env:
CANDIDATE_NAME: ${{ inputs.candidateName }}
- name: Checkout code
Expand All @@ -47,7 +44,7 @@ jobs:
- name: Create release branch
run: git checkout -b $RELEASE_BRANCH_NAME $BRANCH_COMMIT
env:
RELEASE_BRANCH_NAME: ${{ steps.variables.outputs.release_branch_name }}
RELEASE_BRANCH_NAME: ${{ steps.variables.outputs.releaseBranchName }}
BRANCH_COMMIT: ${{ inputs.branchCommit }}
- name: Cherry pick commits
run: |
Expand All @@ -59,157 +56,62 @@ jobs:
done
env:
CHERRYPICK_COMMITS: ${{ inputs.cherrypickCommits }}
- name: Push release branch
- name: Add tag to most recent commit
run: |
git push origin --delete $RELEASE_BRANCH_NAME || true
git push -u origin $RELEASE_BRANCH_NAME
DATE=$(date -d"next-monday - 1week" +'%Y-%m-%d')
T_COMMIT=$(git log -n 1 $RELEASE_BRANCH_NAME --pretty=format:'%H')
git tag -a $TAG_NAME -m "Release week of $DATE" $T_COMMIT
env:
RELEASE_BRANCH_NAME: ${{ steps.variables.outputs.release_branch_name }}
java_unit_tests:
name: Unit Tests
needs: create_release_branch
timeout-minutes: 60
runs-on: [ self-hosted, release ]
steps:
- name: Checkout code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
ref: ${{ needs.create_release_branch.outputs.release_branch_name }}
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Environment
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Unit Tests
run: ./cicd/run-unit-tests
- name: Upload Unit Tests Site Report
uses: ./.github/actions/publish-site-report
with:
output-zip-file: unit-test-report
if: always()
- name: Cleanup Java Environment
uses: ./.github/actions/cleanup-java-env
if: always()
java_integration_smoke_tests_templates:
name: Dataflow Templates Integration Smoke Tests
needs: create_release_branch
timeout-minutes: 60
# Run on any runner that matches all the specified runs-on values.
runs-on: [ self-hosted, release ]
steps:
- name: Checkout code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
ref: ${{ needs.create_release_branch.outputs.release_branch_name }}
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Environment
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Integration Smoke Tests
run: |
./cicd/run-it-smoke-tests \
--changed-files="pom.xml" \
--it-region="us-central1" \
--it-project="cloud-teleport-testing" \
--it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
--it-private-connectivity="datastream-private-connect-us-central1" \
--it-release=true \
--it-retry-failures=2
- name: Publish Smoke Test Site Report
uses: ./.github/actions/publish-site-report
with:
output-zip-file: smoke-test-report
if: always()
- name: Cleanup Java Environment
uses: ./.github/actions/cleanup-java-env
if: always()
java_integration_tests_templates:
name: Dataflow Templates Integration Tests
needs: create_release_branch
timeout-minutes: 240
# Run on any runner that matches all the specified runs-on values.
runs-on: [ self-hosted, release ]
steps:
- name: Checkout code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
ref: ${{ needs.create_release_branch.outputs.release_branch_name }}
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Environment
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Integration Tests
shell: bash
run: |
./cicd/run-it-tests \
--changed-files="pom.xml" \
--it-region="us-central1" \
--it-project="cloud-teleport-testing" \
--it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
--it-private-connectivity="datastream-private-connect-us-central1" \
--it-release=true \
--it-retry-failures=2
- name: Publish Integration Test Site Report
uses: ./.github/actions/publish-site-report
with:
output-zip-file: integration-test-report
if: always()
- name: Cleanup Java Environment
uses: ./.github/actions/cleanup-java-env
if: always()
upload_artifacts:
name: Upload Template Artifacts
needs: [ create_release_branch, java_unit_tests, java_integration_smoke_tests_templates, java_integration_tests_templates ]
runs-on: [ self-hosted, release ]
steps:
- name: Checkout code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
ref: ${{ needs.create_release_branch.outputs.release_branch_name }}
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Create artifacts and push
run: |
./cicd/run-release \
--it-project="dataflow-templates" \
--release-bucket-name="dataflow-templates-staging" \
--release-libraries-bucket-name="dataflow-templates-libraries" \
--release-stage-prefix="${CANDIDATE_NAME}"
env:
CANDIDATE_NAME: ${{ inputs.candidateName }}
- name: Cleanup Java Environment
uses: ./.github/actions/cleanup-java-env
if: always()
release_github:
name: Release on GitHub
needs: [ create_release_branch, upload_artifacts ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
ref: ${{ needs.create_release_branch.outputs.release_branch_name }}
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Add tag to most recent commit
run: |
DATE=$(date -d"next-monday - 1week" +'%Y-%m-%d')
T_COMMIT=$(git log -n 1 $RELEASE_BRANCH_NAME --pretty=format:'%H')
git tag -a $TAG_NAME -m "Release week of $DATE" $T_COMMIT
env:
RELEASE_BRANCH_NAME: ${{ needs.create_release_branch.outputs.release_branch_name }}
TAG_NAME: ${{ needs.create_release_branch.outputs.tag_name }}
- name: Push tags
run: |
git push --delete origin $TAG_NAME || true
git push -u origin --tags
env:
TAG_NAME: ${{ needs.create_release_branch.outputs.tag_name }}
- name: Release
run: |
gh release create $TAG_NAME --title "Dataflow Templates $TAG_NAME" --notes ""
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ needs.create_release_branch.outputs.tag_name }}
RELEASE_BRANCH_NAME: ${{ steps.variables.outputs.releaseBranchName }}
TAG_NAME: ${{ steps.variables.outputs.tagName }}
- name: Setup Environment
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Build
run: ./cicd/run-build
- name: Run Unit Tests
run: ./cicd/run-unit-tests
- name: Run Integration Smoke Tests
run: |
./cicd/run-it-smoke-tests \
--it-region="us-central1" \
--it-project="cloud-teleport-testing" \
--it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
--it-private-connectivity="datastream-private-connect-us-central1" \
--it-spanner-host="https://staging-wrenchworks.sandbox.googleapis.com/" \
--it-release=true \
--it-retry-failures=2
- name: Run Integration Tests
run: |
./cicd/run-it-tests \
--it-region="us-central1" \
--it-project="cloud-teleport-testing" \
--it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
--it-private-connectivity="datastream-private-connect-us-central1" \
--it-spanner-host="https://staging-wrenchworks.sandbox.googleapis.com/" \
--it-release=true \
--it-retry-failures=2
- name: Upload Unit Tests Site Report
uses: ./.github/actions/publish-site-report
with:
output-zip-file: test-report
if: always()
- name: Create artifacts and push
run: |
mvn verify -PtemplatesRelease,splunkDeps,missing-artifact-repos \
-DprojectId="dataflow-templates" \
-DbucketName="dataflow-templates-staging" \
-DlibrariesBucketName="dataflow-templates-libraries" \
-DstagePrefix="${CANDIDATE_NAME}" \
-Dmaven.test.skip -T8 -e
env:
CANDIDATE_NAME: ${{ inputs.candidateName }}
- name: Push tags
run: |
git push -u origin --tags
- name: Release
run: |
gh release create $TAG_NAME --title "Dataflow Templates $TAG_NAME" --notes ""
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ steps.variables.outputs.tagName }}
64 changes: 0 additions & 64 deletions cicd/cmd/run-release/main.go

This file was deleted.

47 changes: 0 additions & 47 deletions cicd/internal/flags/release-flags.go

This file was deleted.

0 comments on commit 07d71ba

Please sign in to comment.