bump Go to 1.21. bump to otel 0.100.0 #1028
Workflow file for this run
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: | |
- '**' | |
pull_request: | |
branches: [main] | |
jobs: | |
setup-environment: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.21" | |
- 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 | |
check-codeowners: | |
runs-on: ubuntu-latest | |
needs: [setup-environment] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Check Code Owner Existence | |
run: ./.github/workflows/scripts/check-codeowners.sh | |
lint-matrix: | |
strategy: | |
matrix: | |
group: | |
- receiver | |
- processor | |
- exporter | |
- connector | |
- extension | |
- internal | |
# - other | |
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.21" | |
- 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 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: ${{ 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 | |
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.21" | |
- 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: CheckDoc | |
run: make checkdoc | |
- name: Porto | |
run: | | |
make -j2 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: crosslink | |
run: | | |
make crosslink | |
git diff --exit-code || (echo 'Replace statements are out of date, please run "make crosslink" and commit the changes in this PR.' && exit 1) | |
- name: Check for go mod dependency changes | |
run: | | |
make gotidy | |
git diff --exit-code || (echo 'go.mod/go.sum deps changes detected, please run "make gotidy" and commit the changes in this PR.' && exit 1) | |
- name: CodeGen | |
run: | | |
make -j2 generate | |
git diff --exit-code ':!*go.sum' || (echo 'Generated code is out of date, please run "make generate" and commit the changes in this PR.' && exit 1) | |
- name: Impi | |
run: make -j2 goimpi | |
- name: Third party licenses | |
run: make all-checkthirdparty | |
unittest-matrix: | |
strategy: | |
matrix: | |
go-version: ["1.21"] | |
group: | |
- receiver | |
- processor | |
- exporter | |
- connector | |
- extension | |
- internal | |
- other | |
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 }} | |
unittest: | |
if: ${{ always() }} | |
strategy: | |
matrix: | |
go-version: ["1.21"] | |
runs-on: ubuntu-latest | |
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 }} ]] | |
then | |
echo "All matrix unit test jobs passed!" | |
else | |
echo "One or more matrix unit test jobs failed." | |
false | |
fi | |
cross-compile: | |
runs-on: ubuntu-latest | |
needs: [unittest, lint] | |
strategy: | |
matrix: | |
os: | |
- darwin | |
- linux | |
- windows | |
arch: | |
- amd64 | |
- arm | |
- arm64 | |
exclude: | |
- os: darwin | |
arch: arm | |
- os: windows | |
arch: arm | |
- os: windows | |
arch: arm64 | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.21" | |
- 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: Build Collector ${{ matrix.binary }} | |
run: make GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} nrotelcomponents |