-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) 路 1.38 KB
/
Copy pathci.yml
File metadata and controls
46 lines (42 loc) 路 1.38 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
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: stable
- name: gofmt
run: |
out=$(gofmt -l .)
if [ -n "$out" ]; then echo "gofmt needed:"; echo "$out"; exit 1; fi
- run: go vet ./...
- uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
with:
version: latest
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: stable
- name: Test with coverage
run: go test -race -coverprofile=coverage.out ./...
shell: bash # uniform arg parsing; Windows pwsh mangles -coverprofile into a phantom ".out" package
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out