| 1 |
name: build-and-test-arm |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: [main] |
| 5 |
tags: |
| 6 |
- "v[0-9]+.[0-9]+.[0-9]+*" |
| 7 |
merge_group: |
| 8 |
types: [checks_requested] |
| 9 |
pull_request: |
| 10 |
env: |
| 11 |
TEST_RESULTS: testbed/tests/results/junit/results.xml |
| 12 |
# Make sure to exit early if cache segment download times out after 2 minutes. |
| 13 |
# We limit cache download as a whole to 5 minutes. |
| 14 |
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 |
| 15 |
|
| 16 |
permissions: read-all |
| 17 |
|
| 18 |
# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616 |
| 19 |
concurrency: |
| 20 |
group: ${{ github.workflow }}-${{ github.ref_name }} |
| 21 |
cancel-in-progress: true |
| 22 |
|
| 23 |
jobs: |
| 24 |
arm-unittest-matrix: |
| 25 |
strategy: |
| 26 |
matrix: |
| 27 |
os: [ubuntu-22.04-arm, macos-14] |
| 28 |
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run ARM') || github.event_name == 'push' || github.event_name == 'merge_group') }} |
| 29 |
runs-on: ${{ matrix.os }} |
| 30 |
steps: |
| 31 |
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 32 |
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 |
| 33 |
with: |
| 34 |
go-version: oldstable |
| 35 |
cache: false |
| 36 |
- name: Cache Go |
| 37 |
id: go-cache |
| 38 |
timeout-minutes: 5 |
| 39 |
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 40 |
with: |
| 41 |
path: | |
| 42 |
~/go/bin |
| 43 |
~/go/pkg/mod |
| 44 |
key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }} |
| 45 |
- name: Install dependencies |
| 46 |
if: steps.go-cache.outputs.cache-hit != 'true' |
| 47 |
run: make gomoddownload |
| 48 |
- name: Run Unit Tests |
| 49 |
run: make -j4 gotest |
| 50 |
arm-unittest: |
| 51 |
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run ARM') || github.event_name == 'push' || github.event_name == 'merge_group') }} |
| 52 |
runs-on: ubuntu-latest |
| 53 |
needs: [arm-unittest-matrix] |
| 54 |
steps: |
| 55 |
- name: Print result |
| 56 |
run: echo ${{ needs.arm-unittest-matrix.result }} |
| 57 |
- name: Interpret result |
| 58 |
run: | |
| 59 |
if [[ success == ${{ needs.arm-unittest-matrix.result }} ]] |
| 60 |
then |
| 61 |
echo "All matrix jobs passed!" |
| 62 |
else |
| 63 |
echo "One or more matrix jobs failed." |
| 64 |
false |
| 65 |
fi |