forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (142 loc) · 5.68 KB
/
build-and-test-arm.yml
File metadata and controls
146 lines (142 loc) · 5.68 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: build-and-test-arm
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
merge_group:
pull_request:
env:
TEST_RESULTS: testbed/tests/results/junit/results.xml
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
permissions: read-all
# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
setup-environment:
runs-on: ubuntu-22.04-arm
if: ${{ github.actor != 'dependabot[bot]' && (!contains(github.event.pull_request.labels.*.name, 'Skip ARM') || github.event_name == 'push' || github.event_name == 'merge_group') }}
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
- run: ./.github/workflows/scripts/free-disk-space.sh
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
id: go-setup
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"
- name: Install dependencies
if: steps.go-setup.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-setup.outputs.cache-hit != 'true'
run: make install-tools
- run: ./.github/workflows/scripts/check-disk-space.sh
arm-unittest-matrix:
needs: [setup-environment]
if: ${{ github.actor != 'dependabot[bot]' && (!contains(github.event.pull_request.labels.*.name, 'Skip ARM') || github.event_name == 'push' || github.event_name == 'merge_group') }}
strategy:
fail-fast: false
matrix:
group:
- receiver-0
- receiver-1
- receiver-2
- receiver-3
- processor-0
- processor-1
- exporter-0
- exporter-1
- exporter-2
- exporter-3
- extension
- connector
- internal
- pkg
- cmd-0
- other
timeout-minutes: 30
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
- run: ./.github/workflows/scripts/free-disk-space.sh
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
id: go-setup
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"
# Unit tests without JUnit output are much faster, so it's fine to run on every PR.
# The only time we don't run them is when we already ran them with JUnit output.
- name: Run Unit Tests
id: tests
if: github.ref != 'refs/heads/main'
run: make -j2 gotest GROUP=${{ matrix.group }}
# JUnit tests are super long, so we only run them on pushes to the main branch.
# This is used for automation that automatically creates issues for flaky tests that are
# merged to main, so we don't run them on every PR.
- name: Run Unit Tests With JUnit and Coverage
id: tests-with-junit
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
continue-on-error: true # Allow uploading artifacts even if the test fails
run: make gotest-with-junit-and-cover GROUP=${{ matrix.group }}
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
name: test-results-arm-${{ matrix.group }}
path: internal/tools/testresults/
retention-days: 4
- name: Fail workflow if tests fails
if: always()
run: |
if [[ "${{ steps.tests-with-junit.outcome }}" == "failure" || "${{ steps.tests.outcome }}" == "failure" ]]; then
echo "Tests failed. Failing workflow."
exit 1
else
echo "Tests passed or were skipped. Continuing."
fi
- run: ./.github/workflows/scripts/check-disk-space.sh
arm-unittest:
if: ${{ github.actor != 'dependabot[bot]' && (!contains(github.event.pull_request.labels.*.name, 'Skip ARM') || github.event_name == 'push' || github.event_name == 'merge_group') }}
runs-on: ubuntu-24.04
needs: [arm-unittest-matrix]
steps:
- name: Print result
run: echo ${{ needs.arm-unittest-matrix.result }}
- name: Interpret result
run: |
if [[ success == ${{ needs.arm-unittest-matrix.result }} ]]
then
echo "All matrix jobs passed!"
else
echo "One or more matrix jobs failed."
false
fi
flakytests-generate-issues:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
needs: [arm-unittest-matrix]
permissions:
issues: write
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
- run: ./.github/workflows/scripts/free-disk-space.sh
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
id: go-setup
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
merge-multiple: true
pattern: test-results-arm-*
path: ./internal/tools/testresults/
- name: Generate Issues
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make install-tools
./.tools/issuegenerator -path ./internal/tools/testresults/ -labels "flaky tests,needs triage"
- run: ./.github/workflows/scripts/check-disk-space.sh