[chore] [exporter/signalfx] enable cpu attr in per-core changelog example #14467
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-and-test | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+*" | |
| merge_group: | |
| pull_request: | |
| # `labeled`/`unlabeled` are required so that adding/removing `ci:full` on | |
| # an open PR retriggers the workflow with the new scope. GitHub doesn't | |
| # let us filter these events by label name at the trigger level, so root | |
| # jobs below also gate on `github.event.label.name == 'ci:full'` to skip | |
| # unrelated label churn (e.g. `waiting-for-code-owners`). | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| permissions: read-all | |
| 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 | |
| # 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: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-24.04 | |
| if: ${{ github.actor != 'dependabot[bot]' && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| check-collector-module-version: | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - run: make genotelcontribcol | |
| - name: Check Collector Module Version | |
| run: ./.github/workflows/scripts/check-collector-module-version.sh | |
| # Runs compute-ci-scope.sh to classify the PR's change set. Outputs two JSON | |
| # matrices that downstream jobs consume directly as their `group` dimension: | |
| # - matrix: modules + transitive dependents (build/test/checks). | |
| # - direct_matrix: modules whose files actually changed (lint-only). A | |
| # downstream module's lint result doesn't depend on | |
| # whether an upstream module's source changed, so lint | |
| # skips transitive dependents. | |
| # In both: | |
| # - full mode: ["receiver-0", "receiver-1", ...] (the named groups) | |
| # - scoped mode: ["receiver/foo receiver/bar", ...] (bucketed module dirs) | |
| # - skip: [] | |
| # The Makefile's FOR_GROUP_TARGET handling treats both formats correctly. | |
| # `mode` is a derived output (skip / full / scoped) used by cross-compile, | |
| # which doesn't fit the group-matrix shape. | |
| ci-scope: | |
| runs-on: ubuntu-24.04 | |
| if: ${{ github.actor != 'dependabot[bot]' && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') }} | |
| outputs: | |
| matrix: ${{ steps.post.outputs.matrix }} | |
| direct_matrix: ${{ steps.post.outputs.direct_matrix }} | |
| mode: ${{ steps.post.outputs.mode }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Compute scope | |
| id: scope | |
| shell: bash | |
| env: | |
| PR_HEAD: ${{ github.event.pull_request.head.sha }} | |
| BASE_REF: ${{ github.base_ref }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| TARGET_CONCURRENCY: 10 | |
| FORCE_ALL: ${{ contains(github.event.pull_request.labels.*.name, 'ci:full') }} | |
| # `^` anchors mean these match files at repo root, not in subdirectories, | |
| # so a receiver-component Makefile change doesn't trigger the full suite. | |
| CRITICAL_FILES: '[ | |
| "^Makefile", | |
| "^Makefile.Common", | |
| "^.golangci.yml", | |
| "^.github/workflows/", | |
| "^.github/actions/", | |
| "^internal/tools/", | |
| "^versions.yaml", | |
| "^cmd/otelcontribcol/" | |
| ]' | |
| ALL_TEST_GROUPS: '[ | |
| "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" | |
| ]' | |
| run: ./.github/workflows/scripts/compute-ci-scope.sh | |
| - name: Filter matrix and derive mode | |
| id: post | |
| shell: bash | |
| env: | |
| RAW_MATRIX: ${{ steps.scope.outputs.matrix }} | |
| RAW_DIRECT_MATRIX: ${{ steps.scope.outputs.direct_matrix }} | |
| run: | | |
| # The script maps top-level files (Makefile, .github/, etc.) to "." | |
| # the root module. Strip "." entries from buckets and drop buckets | |
| # that become empty -- the Makefile's per-module delegation rules | |
| # don't define a target for ".", so `make TARGET GROUP="."` would | |
| # fail with "No rule to make target 'for-.-target'". Top-level paths | |
| # that should force a full run belong in CRITICAL_FILES instead. | |
| filter='[.[] | split(" ") | map(select(. != ".")) | join(" ") | select(. != "")]' | |
| matrix=$(echo "$RAW_MATRIX" | jq -c "$filter") | |
| direct_matrix=$(echo "$RAW_DIRECT_MATRIX" | jq -c "$filter") | |
| echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | |
| echo "direct_matrix=$direct_matrix" >> "$GITHUB_OUTPUT" | |
| # Scoped buckets contain "/" (module paths); full mode emits named | |
| # groups like "receiver-0" (no slashes). [] is skip. `mode` is | |
| # derived from the transitive matrix -- it drives cross-compile | |
| # and gating decisions that need the broader view. | |
| if [[ "$matrix" == "[]" ]]; then | |
| mode=skip | |
| elif [[ "$matrix" == *"/"* ]]; then | |
| mode=scoped | |
| else | |
| mode=full | |
| fi | |
| echo "mode=$mode" >> "$GITHUB_OUTPUT" | |
| echo "Raw matrix: $RAW_MATRIX" | |
| echo "Filtered matrix: $matrix" | |
| echo "Raw direct matrix: $RAW_DIRECT_MATRIX" | |
| echo "Filtered direct matrix: $direct_matrix" | |
| echo "Mode: $mode" | |
| lint-matrix: | |
| needs: [setup-environment, ci-scope] | |
| if: ${{ needs.ci-scope.outputs.direct_matrix != '[]' && needs.ci-scope.outputs.direct_matrix != '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| goos: [windows, linux] | |
| group: ${{ fromJSON(needs.ci-scope.outputs.direct_matrix) }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - name: Lint | |
| run: GOOS=${{ matrix.goos }} GOARCH=amd64 make -j2 golint GROUP="${{ matrix.group }}" | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| lint: | |
| if: ${{ github.actor != 'dependabot[bot]' && always() && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') }} | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment, lint-matrix] | |
| steps: | |
| - name: Print result | |
| run: echo ${{ needs.lint-matrix.result }} | |
| - name: Interpret result | |
| run: | | |
| if [[ success == ${{ needs.lint-matrix.result }} || skipped == ${{ needs.lint-matrix.result }} ]] | |
| then | |
| echo "All matrix jobs passed!" | |
| else | |
| echo "One or more matrix jobs failed." | |
| false | |
| fi | |
| govulncheck: | |
| 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 | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| needs: [setup-environment] | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: 1.25.11 # TODO: revert to oldstable when actions/setup-go reliably resolves oldstable to 1.25.11 | |
| - name: Run `govulncheck` | |
| run: make gogovulncheck GROUP=${{ matrix.group }} | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| checks-matrix: | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment, ci-scope] | |
| if: needs.ci-scope.outputs.mode != 'skip' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: | |
| - codegen-receiver-0 | |
| - codegen-receiver-1 | |
| - codegen-receiver-2 | |
| - codegen-receiver-3 | |
| - codegen-processor-0 | |
| - codegen-processor-1 | |
| - codegen-exporter-0 | |
| - codegen-exporter-1 | |
| - codegen-exporter-2 | |
| - codegen-exporter-3 | |
| - codegen-extension | |
| - codegen-connector | |
| - codegen-internal | |
| - codegen-pkg | |
| - codegen-cmd-0 | |
| - codegen-other | |
| - porto-and-gci | |
| - go-mod-hygiene | |
| - small-generators | |
| - schemas-and-templates | |
| - read-only-checks | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| gomoddownload: ${{ matrix.shard == 'read-only-checks' && 'false' || 'true' }} | |
| - run: make genotelcontribcol | |
| - name: Run shard ${{ matrix.shard }} | |
| run: ./.github/workflows/scripts/run-checks-shard.sh "${{ matrix.shard }}" | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| checks: | |
| if: ${{ github.actor != 'dependabot[bot]' && always() && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') }} | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment, checks-matrix] | |
| steps: | |
| - name: Print result | |
| run: echo ${{ needs.checks-matrix.result }} | |
| - name: Interpret result | |
| run: | | |
| if [[ success == ${{ needs.checks-matrix.result }} || skipped == ${{ needs.checks-matrix.result }} ]] | |
| then | |
| echo "All matrix jobs passed!" | |
| else | |
| echo "One or more matrix jobs failed." | |
| false | |
| fi | |
| unittest-matrix: | |
| needs: [setup-environment, ci-scope] | |
| if: ${{ needs.ci-scope.outputs.matrix != '[]' && needs.ci-scope.outputs.matrix != '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-version: [stable, oldstable] | |
| runner: [ubuntu-24.04] | |
| group: ${{ fromJSON(needs.ci-scope.outputs.matrix) }} | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| # Unit tests without JUnit output are much faster, so it's fine to run on every PR and every go version. | |
| # The only time we don't run them is when we already ran them with JUnit output. | |
| # Which means: | |
| # - On PRs. | |
| # - On main, with the go version that we didn't run the JUnit tests with. | |
| - name: Run Unit Tests | |
| id: tests | |
| if: github.ref != 'refs/heads/main' || !startsWith( matrix.go-version, 'oldstable' ) | |
| run: make gotest GROUP="${{ matrix.group }}" | |
| # JUnit tests are super long, so we only run them for one go version. | |
| # 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: startsWith( matrix.go-version, 'oldstable' ) && 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| if: startsWith( matrix.go-version, 'oldstable' ) && github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| with: | |
| name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.runner }}-${{ matrix.group }} | |
| path: ${{ matrix.group }}-coverage.txt | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| if: startsWith( matrix.go-version, 'oldstable' ) && github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| with: | |
| name: test-results-${{ matrix.go-version }}-${{ matrix.runner }}-${{ 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 | |
| unittest: | |
| if: ${{ github.actor != 'dependabot[bot]' && always() && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') }} | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment, unittest-matrix] | |
| steps: | |
| - name: Print result | |
| run: echo ${{ needs.unittest-matrix.result }} | |
| - name: Interpret result | |
| run: | | |
| if [[ success == ${{ needs.unittest-matrix.result }} || skipped == ${{ needs.unittest-matrix.result }} ]] | |
| then | |
| echo "All matrix jobs passed!" | |
| else | |
| echo "One or more matrix jobs failed." | |
| false | |
| fi | |
| coverage: | |
| runs-on: ubuntu-24.04 | |
| needs: [unittest] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| merge-multiple: true | |
| pattern: coverage-artifacts-* | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| integration-tests-matrix: | |
| needs: [setup-environment, ci-scope] | |
| if: ${{ needs.ci-scope.outputs.matrix != '[]' && needs.ci-scope.outputs.matrix != '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| group: ${{ fromJSON(needs.ci-scope.outputs.matrix) }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - name: Compute Docker cache key | |
| id: docker-cache-key | |
| env: | |
| GROUP: ${{ matrix.group }} | |
| run: | | |
| normalized_group="$( | |
| printf '%s' "$GROUP" \ | |
| | tr '[:space:]' '\n' \ | |
| | sed '/^$/d' \ | |
| | sort \ | |
| | tr '\n' ' ' \ | |
| | sed 's/[[:space:]]\+$//' | |
| )" | |
| group_hash="$(printf '%s' "$normalized_group" | sha256sum | cut -d ' ' -f 1)" | |
| echo "key=docker-${group_hash}" >> "$GITHUB_OUTPUT" | |
| - name: Cache Docker images. | |
| uses: AndreKurait/docker-cache@7a3887908bdb97935395833df69b060cfcca0f7f # 0.7.0 | |
| with: | |
| key: ${{ steps.docker-cache-key.outputs.key }} | |
| - name: Run Integration Tests | |
| run: make gointegration-test GROUP="${{ matrix.group }}" | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| integration-sudo-tests-matrix: | |
| needs: [setup-environment, ci-scope] | |
| if: needs.ci-scope.outputs.mode != 'skip' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| group: | |
| # list of components that require privileged (sudo) access for | |
| # its integration tests `go test -exec sudo -run Sudo -tags=integration` | |
| - extension/cgroupruntimeextension | |
| - receiver/icmpcheckreceiver | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - name: Cache Docker images. | |
| uses: AndreKurait/docker-cache@7a3887908bdb97935395833df69b060cfcca0f7f # 0.7.0 | |
| with: | |
| key: docker-${{ matrix.group }} | |
| - name: Run Integration Tests | |
| run: make --no-print-directory -C ${{ matrix.group }} mod-integration-sudo-test | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| integration-tests: | |
| if: ${{ github.actor != 'dependabot[bot]' && always() && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') }} | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment, integration-tests-matrix, integration-sudo-tests-matrix] | |
| steps: | |
| - name: Print result | |
| run: echo ${{ needs.integration-tests-matrix.result }} | |
| - name: Interpret result | |
| run: | | |
| if [[ success == ${{ needs.integration-tests-matrix.result }} || skipped == ${{ needs.integration-tests-matrix.result }} ]] | |
| then | |
| echo "All matrix jobs passed!" | |
| else | |
| echo "One or more matrix jobs failed." | |
| false | |
| fi | |
| correctness-traces: | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - name: Correctness | |
| run: make -C testbed run-correctness-traces-tests | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| correctness-metrics: | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - name: Correctness | |
| run: make -C testbed run-correctness-metrics-tests | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| build-examples: | |
| runs-on: ubuntu-24.04 | |
| needs: [setup-environment] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| gomoddownload: "false" | |
| - run: make genotelcontribcol | |
| - name: Build Examples | |
| run: make build-examples | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| cross-compile-pr: | |
| if: ${{ github.actor != 'dependabot[bot]' && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:full') }} | |
| runs-on: ${{ matrix.runner }} | |
| needs: [setup-environment] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: linux | |
| arch: amd64 | |
| runner: cncf-ubuntu-8-32-x86 | |
| - os: linux | |
| arch: arm64 | |
| runner: cncf-ubuntu-8-32-arm | |
| # CNCF self-hosted runners on fork PRs cannot fall back to base-branch | |
| # caches, so this job skips actions/setup-go's cache (which would only | |
| # write a parallel PR-scoped entry and pressure the 10 GB pool) and | |
| # builds cold on the larger CNCF hardware. | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version: oldstable | |
| cache: false | |
| - name: Download Go modules | |
| run: make -j8 gomoddownload | |
| - name: Generate collector files | |
| run: make genotelcontribcol | |
| - name: Build Collector ${{ matrix.os }} ${{ matrix.arch }} | |
| run: make GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} otelcontribcollite | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| cross-compile: | |
| if: ${{ github.actor != 'dependabot[bot]' && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} | |
| runs-on: ${{ matrix.runner }} | |
| needs: [setup-environment] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: darwin | |
| arch: amd64 | |
| runner: ubuntu-24.04 | |
| - os: darwin | |
| arch: arm64 | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: "386" | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: amd64 | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: arm | |
| arm: 7 | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| - os: linux | |
| arch: ppc64le | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: riscv64 | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: s390x | |
| runner: ubuntu-24.04 | |
| - os: windows | |
| arch: "386" | |
| runner: ubuntu-24.04 | |
| - os: windows | |
| arch: amd64 | |
| runner: ubuntu-24.04 | |
| - os: windows | |
| arch: arm64 | |
| runner: ubuntu-24.04 | |
| - os: aix | |
| arch: ppc64 | |
| runner: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - name: Generate collector files | |
| run: make genotelcontribcol | |
| - name: Build Collector ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.arm }} | |
| run: make GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM=${{ matrix.arm }} otelcontribcollite | |
| - name: Upload Collector Binaries | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: collector-binaries-${{ matrix.os }}-${{ matrix.arch }} | |
| path: ./bin/* | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| publish-check: | |
| if: ${{ github.actor != 'dependabot[bot]' && ((github.event.action != 'labeled' && github.event.action != 'unlabeled') || github.event.label.name == 'ci:full') && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} | |
| runs-on: ubuntu-24.04 | |
| needs: [lint, unittest, integration-tests, cross-compile] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| sparse-checkout: | | |
| .github/workflows/scripts/verify-dist-files-exist.sh | |
| - name: Download Binaries | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| merge-multiple: true | |
| path: ./bin/ | |
| pattern: collector-binaries-* | |
| - name: Verify Distribution Files Exist | |
| id: check | |
| run: ./.github/workflows/scripts/verify-dist-files-exist.sh | |
| publish-dev: | |
| runs-on: ubuntu-24.04 | |
| needs: [lint, unittest, integration-tests] | |
| if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && github.repository == 'open-telemetry/opentelemetry-collector-contrib' | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| gomoddownload: "false" | |
| - name: Mkdir bin and dist | |
| run: | | |
| mkdir bin/ dist/ | |
| - name: Build Docker Image | |
| run: | | |
| make genotelcontribcol | |
| make docker-otelcontribcol | |
| docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:"$GITHUB_SHA" | |
| docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:latest | |
| - name: Validate Docker Image | |
| run: | | |
| docker run otel/opentelemetry-collector-contrib-dev:"$GITHUB_SHA" --version | |
| docker run otel/opentelemetry-collector-contrib-dev:latest --version | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Push Docker Image | |
| run: | | |
| docker push otel/opentelemetry-collector-contrib-dev:"$GITHUB_SHA" | |
| docker push otel/opentelemetry-collector-contrib-dev:latest | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| publish-stable: | |
| runs-on: ubuntu-24.04 | |
| needs: [lint, unittest, integration-tests] | |
| env: | |
| RELEASE_NOTES: release-notes.md | |
| if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'open-telemetry/opentelemetry-collector-contrib' | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| fetch-depth: 0 | |
| - run: ./.github/workflows/scripts/free-disk-space.sh | |
| - run: | | |
| cp ../configs/build-and-test/package.json . | |
| cp ../configs/build-and-test/package-lock.json . | |
| npm ci | |
| working-directory: ./.github/workflows/scripts | |
| - name: Set current and previous tags | |
| id: github_tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./.github/workflows/scripts/set_release_tag.sh | |
| - name: Prepare release notes | |
| env: | |
| RELEASE_TAG: ${{ steps.github_tag.outputs.tag }} | |
| run: ./.github/workflows/scripts/prepare-release-notes.sh | |
| - name: Generate new contributor celebration text | |
| id: new-contributor-text | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| result-encoding: 'string' | |
| script: | | |
| const { default: script } = await import('${{ github.workspace }}/.github/workflows/scripts/generate-new-contributors.js') | |
| return await script(github, '${{ steps.github_tag.outputs.tag }}', '${{ steps.github_tag.outputs.previous_tag }}') | |
| - name: Prepare full release notes | |
| run: | | |
| echo "" >> ${{ env.RELEASE_NOTES }} | |
| echo "${{ steps.new-contributor-text.outputs.result }}" >> ${{ env.RELEASE_NOTES }} | |
| - name: Create Github Release | |
| run: | | |
| gh release create "$RELEASE_TAG" -t "$RELEASE_TAG" -F ${{ env.RELEASE_NOTES }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_TAG: ${{ steps.github_tag.outputs.tag }} | |
| - run: ./.github/workflows/scripts/check-disk-space.sh | |
| rotate-milestone: | |
| # This job updates the "next release" milestone | |
| # to the latest released version and creates a new milestone | |
| # named "next release" in its place | |
| permissions: | |
| issues: write # required for managing milestones | |
| runs-on: ubuntu-24.04 | |
| needs: [publish-stable] | |
| if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'open-telemetry/opentelemetry-collector-contrib' | |
| steps: | |
| - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 | |
| with: | |
| script: | | |
| const milestones = await github.rest.issues.listMilestones({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: "open" | |
| }) | |
| for (const milestone of milestones.data) { | |
| if (milestone.title == "next release") { | |
| await github.rest.issues.updateMilestone({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| milestone_number: milestone.number, | |
| title: "${{ github.ref_name }}" | |
| }); | |
| await github.rest.issues.createMilestone({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: "next release" | |
| }); | |
| return | |
| } | |
| } | |
| flakytests-generate-issues: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-24.04 | |
| needs: [unittest-matrix] | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: ./.github/actions/setup-go-tools | |
| with: | |
| go-version: oldstable | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| merge-multiple: true | |
| pattern: test-results-* | |
| path: ./internal/tools/testresults/ | |
| - name: Generate Issues | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| go tool -modfile=./internal/tools/go.mod go.opentelemetry.io/build-tools/issuegenerator -path ./internal/tools/testresults/ -labels "flaky tests,needs triage" | |
| - run: ./.github/workflows/scripts/check-disk-space.sh |