|
43 | 43 | with:
|
44 | 44 | name: colcon-logs-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}
|
45 | 45 | path: ros_ws/log
|
| 46 | + log_workflow_status_to_cloudwatch: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + container: |
| 49 | + image: ubuntu:bionic |
| 50 | + needs: |
| 51 | + - build_and_test_release_latest |
| 52 | + # Don't skip if prior steps failed, but don't run on a fork because it won't have access to AWS secrets |
| 53 | + if: ${{ always() && ! github.event.repository.fork && ! github.event.pull_request.head.repo.fork }} |
| 54 | + steps: |
| 55 | + - name: Configure AWS Credentials |
| 56 | + uses: aws-actions/configure-aws-credentials@v1 |
| 57 | + with: |
| 58 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 59 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 60 | + aws-region: ${{ secrets.AWS_REGION }} |
| 61 | + - uses: ros-tooling/[email protected] |
| 62 | + with: |
| 63 | + metric-dimensions: >- |
| 64 | + [ |
| 65 | + { "Name": "github.event_name", "Value": "${{ github.event_name }}" }, |
| 66 | + { "Name": "github.ref", "Value": "release-latest" }, |
| 67 | + { "Name": "github.repository", "Value": "${{ github.repository }}" } |
| 68 | + ] |
| 69 | + # Checks if any of the jobs have failed. |
| 70 | + # |
| 71 | + # needs.*.result is returns the list of all success statuses as an |
| 72 | + # array, i.e. ['success', 'failure, 'success'] |
| 73 | + # join() converts the array to a string 'successfailuresuccess' |
| 74 | + # contains() checks whether the string contains failure |
| 75 | + metric-value: ${{ ! contains(join(needs.*.result, ''), 'failure') && ! contains(join(needs.*.result, ''), 'cancelled') }} |
0 commit comments