-
Notifications
You must be signed in to change notification settings - Fork 19
99 lines (86 loc) · 2.86 KB
/
integration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Integration
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
schedule:
- cron: "0 * * * *" # run once every hour
jobs:
smoke-test:
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
- 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]
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 }}
- 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, 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.outputs.trace-start}}