From 51cdc917829357dd4648eb05554975b5248d8b16 Mon Sep 17 00:00:00 2001 From: Levi Schoen Date: Thu, 15 Dec 2022 11:45:18 -0800 Subject: [PATCH] post metrics for ci runs --- .github/workflows/ci-pr.yml | 6 ++++++ .github/workflows/metric-pipeline.yml | 30 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/metric-pipeline.yml diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index e947eff6..3727fd94 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -9,3 +9,9 @@ on: jobs: default: uses: ./.github/workflows/ci-default.yml + post-pipeline-metrics: + uses: ./.github/workflows/metric-pipeline.yml + if: always() # always run so we metric failures and successes + with: + aws-region: us-east-1 + secrets: inherit diff --git a/.github/workflows/metric-pipeline.yml b/.github/workflows/metric-pipeline.yml new file mode 100644 index 00000000..b982c4c8 --- /dev/null +++ b/.github/workflows/metric-pipeline.yml @@ -0,0 +1,30 @@ +name: Metric Pipeline + +on: + workflow_call: + inputs: + aws-region: + required: true + type: string + secrets: + CI_AWS_KEY_ID: + required: true + CI_AWS_KEY_SECRET: + required: true + +jobs: + metric-pipeline-result: + runs-on: ubuntu-latest + steps: + # Make sure the secrets are stored in you repo settings + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.CI_AWS_KEY_ID }} + aws-secret-access-key: ${{ secrets.CI_AWS_KEY_SECRET }} + aws-region: ${{ inputs.aws-region }} + if: always() # Setup credentials even if the workflow failed + - name: Log Build + # replace TAG by the latest tag in the repository + uses: ros-tooling/action-cloudwatch-metrics@0.0.5 + if: always() # Need to run to log the workflow failure