-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.24 KB
/
ci.yml
File metadata and controls
58 lines (47 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CI
on:
push:
branches: [main, feature/*]
pull_request:
branches: [main, feature/*]
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Configure git line endings
run: git config --global core.autocrlf false
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: go build ./...
- name: Test
shell: bash
run: go test -race "-coverprofile=coverage.out" ./...
- name: Vet
run: go vet ./...
- name: Format check
shell: bash
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Files not formatted:"
gofmt -l .
exit 1
fi
- name: Lint
if: matrix.os == 'ubuntu-latest'
uses: golangci/golangci-lint-action@v9
with:
version: v2.10.1
- name: Upload coverage
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}