Skip to content

RegisterDBStatsMetrics now returns a metric.Registration for unregister #2519

RegisterDBStatsMetrics now returns a metric.Registration for unregister

RegisterDBStatsMetrics now returns a metric.Registration for unregister #2519

Workflow file for this run

name: ci
permissions: read-all
on:
push:
branches:
- main
pull_request:
env:
# Path to where test results will be saved.
TEST_RESULTS: /tmp/test-results
# Default version of Go to use by CI workflows. This should be the latest
# release of Go; developers likely use the latest release in development and
# we want to catch any bugs (e.g. lint errors, race detection) with this
# release before they are merged. The Go compatibility guarantees ensure
# backwards compatibility with the previous two minor releases and we
# explicitly test our code for these versions so keeping this at prior
# versions does not add value.
DEFAULT_GO_VERSION: "~1.25.0"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Tools cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
env:
cache-name: go-tools-cache
with:
path: .tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Run linters
run: make license-check lint
- name: Build
run: make build
- name: Check clean repository
run: make check-clean-work-tree
test-race:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Tools cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
env:
cache-name: go-tools-cache
with:
path: .tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Run tests with race detector
run: make test-race
- name: Run benchmarks with race detector
run: make test-bench
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Tools cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
env:
cache-name: go-tools-cache
with:
path: .tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Run coverage tests
run: |
make test-coverage
mkdir $TEST_RESULTS
cp coverage.out $TEST_RESULTS
cp coverage.txt $TEST_RESULTS
cp coverage.html $TEST_RESULTS
- name: Upload coverage report
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
file: ./coverage.txt
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Store coverage test output
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: opentelemetry-go-test-output
path: ${{ env.TEST_RESULTS }}
compatibility-test:
strategy:
matrix:
go-version: ["1.25.0", "1.24.0"]
os: [ubuntu-latest, macos-latest, windows-latest]
# GitHub Actions does not support arm* architectures on default
# runners. It is possible to acomplish this with a self-hosted runner
# if we want to add this in the future:
# https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
arch: ["386", amd64]
exclude:
# Not a supported Go OS/architecture.
- os: macos-latest
arch: "386"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "**/go.sum"
- name: Tools cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
env:
cache-name: go-tools-cache
with:
path: .tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Run tests
env:
GOARCH: ${{ matrix.arch }}
run: make test-short