Skip to content

[processor/resourcedetection] add host.interface resource attribute to system detector #33593

[processor/resourcedetection] add host.interface resource attribute to system detector

[processor/resourcedetection] add host.interface resource attribute to system detector #33593

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:
arm-unittest-matrix:
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version: 1.23.9
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-build-cache-ubuntu-22.04-arm-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools
# 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@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
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
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version: 1.23.9
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: |
~/go/bin
~/go/pkg/mod
./.tools
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
with:
merge-multiple: true
pattern: test-results-arm-*
path: ./internal/tools/testresults/
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Generate Issues
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./.tools/issuegenerator -path ./internal/tools/testresults/