Alex/cos 3288 website not populating on prospects #1596
Workflow file for this run
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: events-processing-platform-subscribers | |
on: | |
push: | |
branches: ["otter"] | |
paths: | |
- packages/server/customer-os-common-ai/** | |
- packages/server/customer-os-common-module/** | |
- packages/server/customer-os-common-auth/** | |
- packages/server/customer-os-postgres-repository/** | |
- packages/server/customer-os-neo4j-repository/** | |
- packages/server/events-processing-proto/** | |
- packages/server/events-processing-platform/** | |
- packages/server/events-processing-platform-subscribers/** | |
- .github/workflows/build-events-processing-platform-subscribers.yml | |
pull_request: | |
paths: | |
- packages/server/customer-os-common-ai/** | |
- packages/server/customer-os-common-module/** | |
- packages/server/customer-os-common-auth/** | |
- packages/server/customer-os-postgres-repository/** | |
- packages/server/customer-os-neo4j-repository/** | |
- packages/server/events-processing-proto/** | |
- packages/server/events-processing-platform/** | |
- packages/server/events-processing-platform-subscribers/** | |
- .github/workflows/build-events-processing-platform-subscribers.yml | |
release: | |
types: [created, edited] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}/events-processing-platform-subscribers | |
permissions: | |
contents: read | |
pull-requests: read | |
packages: write | |
defaults: | |
run: | |
working-directory: ./packages/server/events-processing-platform-subscribers | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20.5" | |
- name: Build | |
run: make all | |
- name: Configure Test Folders | |
id: test-folders | |
run: | | |
test_folders=$(go list ./... | grep -v /gen | grep -v /test | paste -sd "," -) | |
echo "{name}={test_folders}" >> $GITHUB_OUTPUT | |
- name: Test | |
run: gotestsum --junitfile unit-tests.xml -- -coverprofile=cover.out -coverpkg=${{ steps.test-folders.outputs.test_folders }} ./... | |
- name: Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() # run this step even if previous step failed | |
with: | |
report_paths: ./packages/server/events-processing-platform-subscribers/unit-tests.xml # Path to test results | |
include_passed: true | |
annotate_only: true | |
detailed_summary: true | |
- name: Compute Code Coverage | |
id: compute_code_coverage | |
run: | | |
echo "## Code Coverage" >> $GITHUB_STEP_SUMMARY | |
echo "|Filename|Function|Coverage|" >> $GITHUB_STEP_SUMMARY | |
echo "|--------|--------|--------|" >> $GITHUB_STEP_SUMMARY | |
go tool cover -func=cover.out |sed -r 's/[[:space:]]+/|/g'|sed -r 's/$/|/g'|sed -r 's/^/|/g' >> $GITHUB_STEP_SUMMARY | |
go tool cover -func=cover.out | sed -r 's/[[:space:]]+/|/g' | sed -r 's/$/|/g' | sed -r 's/^/|/g' | tail -n 1 > test-coverage.txt | |
coverage=$(cat test-coverage.txt | awk -F'|' '{gsub(/%/, "", $(NF-1)); print $(NF-1)}') | |
echo "::set-output name=computed_coverage::$coverage" | |
- name: Send Output to Slack | |
run: | | |
computed_coverage="${{ steps.compute_code_coverage.outputs.computed_coverage }}" | |
warning_threshold=80.0 | |
critical_threshold=50.0 | |
if (( $(echo "$computed_coverage > $warning_threshold" | bc -l) )); then | |
curl -X POST -H 'Content-type: application/json' --data '{ | |
"text": "${{ github.workflow }} coverage ${{ steps.compute_code_coverage.outputs.computed_coverage }}: '$(cat test-coverage.txt)'" | |
}' ${{ secrets.TEST_COVERAGE_SLACK_WEBHOOK_URL }} | |
elif (( $(echo "$computed_coverage < $warning_threshold && $computed_coverage > $critical_threshold" | bc -l) )); then | |
curl -X POST -H 'Content-type: application/json' --data '{ | |
"text": ":warning: ${{ github.workflow }} coverage is lower than the warning threshold of 80%: '$(cat test-coverage.txt)'" | |
}' ${{ secrets.TEST_COVERAGE_SLACK_WEBHOOK_URL }} | |
elif (( $(echo "$computed_coverage < $critical_threshold" | bc -l) )); then | |
curl -X POST -H 'Content-type: application/json' --data '{ | |
"text": ":no_entry: ${{ github.workflow }} coverage is lower than the critical threshold of 50%: '$(cat test-coverage.txt)'" | |
}' ${{ secrets.TEST_COVERAGE_SLACK_WEBHOOK_URL }} | |
fi | |
build-publish: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3.1.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.REPOSITORY_READ_WRITE_USERNAME }} | |
password: ${{ secrets.REPOSITORY_READ_WRITE_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5.5.1 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Push Docker image | |
uses: docker/build-push-action@v5.3.0 | |
with: | |
context: ./packages/server/ | |
file: ./packages/server/events-processing-platform-subscribers/Dockerfile | |
push: ${{ github.ref_name == 'otter' || github.event_name == 'release' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |