Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

[upstream] Bump up otel col contrib to v0.101.0 #194

[upstream] Bump up otel col contrib to v0.101.0

[upstream] Bump up otel col contrib to v0.101.0 #194

Workflow file for this run

name: build-and-test
on:
push:
branches: [ main ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
env:
TEST_RESULTS: testbed/tests/results/junit/results.xml
# See: https://github.com/actions/cache/issues/810#issuecomment-1222550359
# Cache downloads for this workflow consistently run in under 1 minute
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
setup-environment:
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21.9"
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ 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-builder-tools
lint-matrix:
strategy:
matrix:
group:
- exporter
- extension
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21.9"
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ 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-builder-tools
- name: Cache Lint Build
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: go-lint-build-${{ matrix.group }}-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Lint
run: make -j2 golint GROUP=${{ matrix.group }}
lint:
if: ${{ github.actor != 'dependabot[bot]' && always() }}
runs-on: ubuntu-latest
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 }} ]]
then
echo "All matrix jobs passed!"
else
echo "One or more matrix jobs failed."
false
fi
unittest-matrix:
strategy:
matrix:
go-version: ["~1.22.2", "~1.21.9"] # 1.20 is interpreted as 1.2 without quotes
group:
- processor
- exporter
- extension
- internal
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go
id: go-cache
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ 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
- name: Cache Test Build
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: go-test-build-${{ runner.os }}-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: make gotest GROUP=${{ matrix.group }}
cross-compile:
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
os:
- darwin
- linux
- windows
arch:
- 386
- amd64
- arm
- arm64
- ppc64le
include:
- os: linux
- arch: arm
- arm: 7
exclude:
- os: darwin
arch: 386
- os: darwin
arch: arm
- os: darwin
arch: ppc64le
- os: windows
arch: arm
- os: windows
arch: arm64
- os: windows
arch: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ~1.21.9
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ 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-builder-tools
- name: Build Collector ${{ matrix.binary }}
run: make GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} build-openinsight