start the release cycle of v2.1.2 (#718) #29
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: Master branch CI | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
run-unit-tests: | |
name: Run Unit Tests | |
uses: ./.github/workflows/test.yaml | |
secrets: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
lint: | |
name: Lint | |
uses: ./.github/workflows/lint-go.yaml | |
run-e2e-tests: | |
name: E2E Tests | |
uses: ./.github/workflows/test-e2e.yaml | |
generate-tags: | |
name: Generate Docker Tags | |
runs-on: ubuntu-latest | |
outputs: | |
tag_date: ${{ steps.tag_date.outputs.tag_date }} | |
short_sha: ${{ steps.short_sha.outputs.short_sha }} | |
steps: | |
- name: Generate Tag Date | |
id: tag_date | |
run: echo "tag_date=$(date +'%Y%m%d')" >> "$GITHUB_OUTPUT" | |
- name: Generate Short SHA | |
id: short_sha | |
run: echo "short_sha=$(echo $GITHUB_SHA | cut -c1-7)" >> "$GITHUB_OUTPUT" | |
publish-docker-image: | |
name: Publish Docker Image | |
uses: ./.github/workflows/publish-docker-images.yaml | |
secrets: inherit | |
needs: | |
- run-unit-tests | |
- run-e2e-tests | |
- generate-tags | |
- lint | |
permissions: | |
contents: read | |
packages: write | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
# eg: master-20240321-7d8e9f2 | |
tags: | | |
type=raw,value=master-${{ needs.generate-tags.outputs.tag_date }}-${{ needs.generate-tags.outputs.short_sha }} | |
type=raw,value=master-latest | |
notify-slack: | |
name: Notify Slack | |
needs: | |
- publish-docker-image | |
- generate-tags | |
- lint | |
- run-unit-tests | |
if: always() && (needs.publish-docker-image.result != 'success' || needs.run-unit-tests.result != 'success' || needs.lint.result != 'success' || needs.run-e2e-tests.result != 'success') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify Slack | |
uses: slackapi/[email protected] | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
payload: | | |
{ | |
"unit-test-status": "${{ needs.run-unit-tests.result != 'success' && ':alert: Failure' || ':white_check_mark: Success' }}", | |
"docker-publish-status": "${{ needs.publish-docker-image.result != 'success' && ':alert: Failure' || ':white_check_mark: Success' }}", | |
"commit-message": "${{ github.event.head_commit.message }}", | |
"commit-url": "${{ github.event.head_commit.url }}", | |
"e2e-test-status": "${{ needs.run-e2e-tests.result != 'success' && ':alert: Failure' || ':white_check_mark: Success' }}", | |
"branch": "${{ github.ref }}", | |
"status": "${{ job.status }}", | |
"repository": "${{ github.repository }}", | |
"commit-author": "${{ github.event.head_commit.author.name }}", | |
"lint-status": "${{ needs.lint.result != 'success' && ':alert: Failure' || ':white_check_mark: Success' }}" | |
} | |