fix: Introduce a new Span.Name field (#605) #593
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: Test | |
on: | |
push: | |
branches: | |
- master | |
- release/** | |
pull_request: | |
permissions: | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: test-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Module Mode | |
runs-on: ${{ matrix.os }}-latest | |
env: | |
GO111MODULE: "on" | |
GOFLAGS: "-mod=readonly" | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v2 | |
with: | |
# In order: | |
# * Module download cache | |
# * Build cache (Linux) | |
# * Build cache (Mac) | |
# * Build cache (Windows) | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
%LocalAppData%\go-build | |
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-${{ matrix.go }}- | |
${{ runner.os }}-go- | |
- name: Build | |
run: make build | |
- name: Vet | |
run: make vet | |
- name: Check go.mod Tidiness | |
run: make mod-tidy | |
if: ${{ matrix.go == '1.20' }} | |
- name: Test | |
run: make test | |
- name: Test (with race detection) | |
run: make test-race | |
# The race detector adds considerable runtime overhead. To save time on | |
# pull requests, only run this step for a single job in the matrix. For | |
# all other workflow triggers (e.g., pushes to a release branch) run | |
# this step for the whole matrix. | |
if: ${{ github.event_name != 'pull_request' || (matrix.go == '1.20' && matrix.os == 'ubuntu') }} | |
- name: Collect coverage | |
run: make test-coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: .coverage | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
go: ["1.20", "1.19", "1.18"] | |
os: [ubuntu, windows, macos] | |
fail-fast: false | |
# Test the GOPATH mode with the oldest Go version we support | |
test-gopath: | |
name: GOPATH Mode | |
runs-on: ubuntu-latest | |
env: | |
# We use two paths in GOPATH. | |
# The first one is where 'go get' will download dependencies, and | |
# the second is where sentry-go itself will be checked out. | |
GOPATH: ${{ github.workspace }}/deps:${{ github.workspace }}/main | |
GO111MODULE: "off" | |
WORKDIR: ${{ github.workspace }}/main/src/github.com/getsentry/sentry-go | |
defaults: | |
run: | |
working-directory: ${{ env.WORKDIR }} | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18" | |
- uses: actions/checkout@v3 | |
with: | |
path: ${{ env.WORKDIR }} | |
# TODO: cache dependencies | |
# - uses: actions/cache@v2 | |
# with: | |
# # In order: | |
# # * GOPATH with dependencies (but without sentry-go) | |
# # * GOPATH with sentry-go installed package objects (*.a files) | |
# # * Build cache (Linux) | |
# path: | | |
# ${{ github.workspace }}/deps | |
# ${{ github.workspace }}/main/pkg | |
# ~/.cache/go-build | |
# key: gopath-${{ github.ref }} | |
# restore-keys: | | |
# gopath- | |
- name: Remove Unsupported Code | |
run: | | |
# Iris requires Module mode, therefore we delete the relevant code to | |
# skip testing it in GOPATH mode. | |
rm -vrf ./iris/ ./_examples/iris/ | |
- name: Download Dependencies | |
run: go get -d -t -v ./... | |
- name: Build | |
run: go build ./... | |
- name: Vet | |
run: go vet ./... | |
- name: Test | |
run: make test-race | |
timeout-minutes: 10 |