Skip to content

Commit dac6d3b

Browse files
committed
add main build metrics
1 parent 8a3b772 commit dac6d3b

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

.github/workflows/main-build.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,22 @@ jobs:
263263
adot-image-name: ${{ needs.build.outputs.staging-image }}
264264

265265
publish-build-status:
266-
needs: [ build, contract-tests ]
267-
if: ${{ always() }}
268-
uses: ./.github/workflows/publish-status.yml
269-
with:
270-
namespace: 'ADOT/GitHubActions'
271-
repository: ${{ github.repository }}
272-
branch: ${{ github.ref_name }}
273-
workflow: main-build
274-
success: ${{ needs.build.result == 'success' &&
275-
needs.contract-tests.result == 'success' }}
276-
region: us-east-1
277-
secrets:
278-
roleArn: ${{ secrets.METRICS_ROLE_ARN }}
266+
name: "Publish Main Build Status"
267+
needs: [ build, contract-tests, application-signals-e2e-test ]
268+
runs-on: ubuntu-latest
269+
if: always()
270+
steps:
271+
- name: Configure AWS Credentials for emitting metrics
272+
uses: aws-actions/configure-aws-credentials@v4
273+
with:
274+
role-to-assume: ${{ secrets.METRICS_ROLE_ARN }}
275+
aws-region: us-east-1
276+
277+
- name: Publish main build status
278+
run: |
279+
success="${{ needs.build.result == 'success' && needs.contract-tests.result == 'success' && needs.application-signals-e2e-test.result == 'success' }}"
280+
value="${success}" == "true" && "0.0" || "1.0"
281+
aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
282+
--metric-name Failure \
283+
--dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=main_build \
284+
--value $value

0 commit comments

Comments
 (0)