-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 1.22 KB
/
Copy pathci.yml
File metadata and controls
55 lines (51 loc) · 1.22 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
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: test (go ${{ matrix.go-version }} / ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.26']
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: gofmt check
shell: bash
run: |
files="$(git ls-files '*.go')"
if [ -z "$files" ]; then
exit 0
fi
out="$(printf '%s\n' "$files" | xargs gofmt -l)"
if [ -n "$out" ]; then
printf '%s\n' "$out"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go test
run: go test ./...
- name: go build
run: go build ./cmd/msx
race:
name: race (ubuntu-latest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache: true
- name: go test -race
run: go test -race ./...