Skip to content

Commit 4114bd7

Browse files
author
Aleksandr Nekrasov
committed
chore: added ci
1 parent ff4dcb1 commit 4114bd7

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
env:
8+
# Path to where test results will be saved.
9+
TEST_RESULTS: /tmp/test-results
10+
# Default version of Go to use by CI workflows. This should be the latest
11+
# release of Go; developers likely use the latest release in development and
12+
# we want to catch any bugs (e.g. lint errors, race detection) with this
13+
# release before they are merged. The Go compatibility guarantees ensure
14+
# backwards compatibility with the previous two minor releases and we
15+
# explicitly test our code for these versions so keeping this at prior
16+
# versions does not add value.
17+
DEFAULT_GO_VERSION: "1.21"
18+
19+
jobs:
20+
test-coverage:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout Repo
24+
uses: actions/checkout@v3
25+
- name: Setup Environment
26+
run: |
27+
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
28+
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
29+
- name: Install Go
30+
uses: actions/setup-go@v4
31+
with:
32+
go-version: ${{ env.DEFAULT_GO_VERSION }}
33+
cache-dependency-path: "**/go.sum"
34+
- name: Run coverage tests
35+
run: |
36+
make test-coverage
37+
- name: Upload coverage reports to codecov
38+
uses: codecov/codecov-action@v3
39+
env:
40+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

otelslog/otel_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestNewOtelHandler(t *testing.T) {
4242
)
4343

4444
handler := NewOtelHandler(loggerProvider, &HandlerOptions{
45-
level: slog.LevelInfo,
45+
Level: slog.LevelInfo,
4646
}).
4747
WithAttrs([]slog.Attr{slog.String("first", "value1")}).
4848
WithGroup("group1").

0 commit comments

Comments
 (0)