Skip to content

Integration No Init Event #10324

Integration No Init Event

Integration No Init Event #10324

name: Integration No Init Event
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
schedule:
- cron: "0 * * * *" # run once every hour
jobs:
smoke-test-no-init-event:
name: Smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set trace-start
id: set-trace-start
run: |
echo "trace-start=$(date +%s)" >> $GITHUB_OUTPUT
- name: Buildevents
uses: ./
with:
apikey: ${{ secrets.BUILDEVENTS_APIKEY }}
dataset: gha-buildevents_integration
send-init-event: false
- name: Print contents of BUILDEVENT_FILE
run: |
echo Contents of BUILDEVENT_FILE:
cat $BUILDEVENT_FILE
- run: |
STEP_ID=smoke-test
echo "STEP_ID=${STEP_ID}" >> $GITHUB_ENV
echo "STEP_START=$(date +%s)" >> $GITHUB_ENV
- run: |
buildevents cmd $TRACE_ID $STEP_ID sleep -- sleep 5
- run: |
buildevents cmd $TRACE_ID $STEP_ID 'sleep some more' -- sleep 2
- run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START $STEP_ID
outputs:
trace-start: ${{ steps.set-trace-start.outputs.trace-start }}
matrix:
name: Matrix
runs-on: ubuntu-latest
needs: [smoke-test-no-init-event]
strategy:
fail-fast: false
matrix:
value: [valueA, valueB]
steps:
- uses: actions/checkout@v4
- name: Buildevents
uses: ./
with:
apikey: ${{ secrets.BUILDEVENTS_APIKEY }}
dataset: gha-buildevents_integration
matrix-key: ${{ matrix.value }}
send-init-event: false
- run: |
STEP_ID=matrix-${{ matrix.value }}
echo "STEP_ID=${STEP_ID}" >> $GITHUB_ENV
echo "STEP_START=$(date +%s)" >> $GITHUB_ENV
- run: |
buildevents cmd $TRACE_ID $STEP_ID ${{ matrix.value }} -- echo The matrix value is ${{ matrix.value }}
- run: |
buildevents cmd $TRACE_ID $STEP_ID sleep -- sleep 2
- run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START $STEP_ID
end-trace:
name: End Trace
runs-on: ubuntu-latest
needs: [smoke-test-no-init-event, matrix]
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- uses: technote-space/workflow-conclusion-action@v3
- name: Buildevents
uses: ./
with:
# Required: a Honeycomb API key - needed to send traces.
# this must be set in your GitHub repository under Settings > Secrets > Actions
apikey: ${{ secrets.BUILDEVENTS_APIKEY }}
# Required: the Honeycomb dataset to send traces to.
dataset: gha-buildevents_integration
# Required: the job status, this will be used in the post section and sent
# as status of the trace. Must always be ${{ job.status }}.
status: ${{ env.WORKFLOW_CONCLUSION }}
trace-start: ${{ needs.smoke-test-no-init-event.outputs.trace-start}}
send-init-event: false