Remove deprecated Delete
pdata func from (v0.47.0) (#5307)
#1
This file contains 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]+*" | |
pull_request: | |
jobs: | |
setup-environment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
- name: Setup Go Environment | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Cache Go | |
id: module-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/pkg/mod | |
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Install dependencies | |
if: steps.module-cache.outputs.cache-hit != 'true' | |
run: make gomoddownload | |
- name: Cache Tools | |
id: tool-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/bin | |
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} | |
- name: Install Tools | |
if: steps.tool-cache.outputs.cache-hit != 'true' | |
run: make install-tools | |
lint: | |
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: 1.17 | |
- name: Setup Go Environment | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Cache Go | |
id: module-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/pkg/mod | |
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Cache Tools | |
id: tool-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/bin | |
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} | |
- name: golint | |
run: make -j2 golint | |
- name: goimpi | |
run: make goimpi | |
checks: | |
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: 1.17 | |
- name: Setup Go Environment | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Cache Go | |
id: module-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/pkg/mod | |
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Cache Tools | |
id: tool-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/bin | |
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} | |
- name: checklicense | |
run: make checklicense | |
- name: misspell | |
run: make misspell | |
- name: checkdoc | |
run: make checkdoc | |
- name: go:porto | |
run: | | |
make goporto | |
git diff --exit-code || (echo 'Porto links are out of date, please run "make goporto" and commit the changes in this PR.' && exit 1) | |
- name: go:generate | |
run: | | |
make gogenerate | |
git diff --exit-code || (echo 'Generated code is out of date, please run "make gogenerate" and commit the changes in this PR.' && exit 1) | |
- name: Gen Pdata | |
run: | | |
make genpdata | |
git diff --exit-code || (echo 'Generated code is out of date, please run "make genpdata" and commit the changes in this PR.' && exit 1) | |
- name: Gen dependabot | |
run: | | |
make gendependabot | |
git diff -s --exit-code || (echo 'ALL_MODULES have been changed, please run "make gendependabot" and commit the changes in this PR.' && exit 1) | |
- name: Gen otelcorecol | |
run: | | |
make genotelcorecol | |
git diff -s --exit-code || (echo 'Generated code is out of date, please run "make genotelcorecol" and commit the changes in this PR.' && exit 1) | |
- name: Multimod verify | |
run: make multimod-verify | |
unittest: | |
strategy: | |
matrix: | |
go-version: [1.18, 1.17] | |
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: Setup Go Environment | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Cache Go | |
id: module-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/pkg/mod | |
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Cache Tools | |
id: tool-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/bin | |
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} | |
- name: Cache Build | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/.cache/go-build | |
key: go-build-unittest-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Run Unit Tests | |
run: make gotest | |
test-coverage: | |
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: 1.17 | |
- name: Setup Go Environment | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Cache Go | |
id: module-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/pkg/mod | |
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Cache Tools | |
id: tool-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/bin | |
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} | |
- name: Cache Build | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/.cache/go-build | |
key: go-build-coverage-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Run Unit Tests With Coverage | |
run: make gotest-with-cover | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.txt | |
fail_ci_if_error: true | |
verbose: true | |
cross-build-collector: | |
needs: [setup-environment] | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Go 1.15 dropped support for 32-bit binaries | |
# on macOS: https://go.dev/doc/go1.15 | |
#- goos: darwin | |
# goarch: 386 | |
- goos: darwin | |
goarch: amd64 | |
- goos: darwin | |
goarch: arm64 | |
- goos: linux | |
goarch: 386 | |
- goos: linux | |
goarch: amd64 | |
- goos: linux | |
goarch: arm64 | |
- goos: windows | |
goarch: 386 | |
- goos: windows | |
goarch: amd64 | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
- name: Setup Go Environment | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Cache Go | |
id: module-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/pkg/mod | |
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Cache Tools | |
id: tool-cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/go/bin | |
key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} | |
- name: Build | |
env: | |
GOOS: ${{matrix.goos}} | |
GOARCH: ${{matrix.goarch}} | |
run: | | |
make otelcorecol |