Debian Codegraph @

.github/workflows/go.yml

raw
1 name: Go
2
3 on:
4 push:
5 branches: [ master ]
6 pull_request:
7 branches: [ master ]
8
9
10 jobs:
11 build:
12 strategy:
13 matrix:
14 go-version: [1.24.x, 1.25.x, 1.26.x]
15 os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
16 env:
17 CGO_ENABLED: 0
18 runs-on: ${{ matrix.os }}
19 steps:
20 - name: Set up Go
21 uses: actions/setup-go@v2
22 with:
23 go-version: ${{ matrix.go-version }}
24
25 - name: CPU support
26 run: go install github.com/klauspost/cpuid/v2/cmd/cpuid@latest&&cpuid
27
28 - name: Checkout code
29 uses: actions/checkout@v2
30
31 - name: Vet
32 run: go vet ./...
33
34 - name: Test
35 run: go test -timeout=15m
36
37 - name: Test Noasm
38 run: go test -tags=noasm -short&&go test -short -no-avx512&&go test -short -no-avx512 -no-avx-gfni&&go test -short -no-avx512 -no-avx2&&go test -no-avx512 -no-avx2 -no-ssse3 -short
39
40 - name: Test Nopshufb
41 run: go test -tags=nopshufb -short&&go test -tags=nopshufb -short -no-avx512&&go test -tags=nopshufb -short -no-avx512 -no-avx-gfni&&go test -tags=nopshufb -no-avx512 -no-avx2 -no-ssse3 -no-sse2 -short
42
43 - name: Test Race
44 env:
45 CGO_ENABLED: 1
46 run: go test -cpu="1,4" -short -race -v -timeout 20m .
47
48 build-special:
49 env:
50 CGO_ENABLED: 0
51 runs-on: ubuntu-latest
52 steps:
53 - name: Set up Go
54 uses: actions/setup-go@v2
55 with:
56 go-version: 1.25.x
57
58 - name: Checkout code
59 uses: actions/checkout@v2
60
61 - name: fmt
62 run: diff <(gofmt -d .) <(printf "")
63
64 - name: Test 386
65 run: GOOS=linux GOARCH=386 go test -short ./...
66
67 - name: Build examples
68 run: go build examples/simple-decoder.go&&go build examples/simple-encoder.go&&go build examples/stream-decoder.go&&go build examples/stream-encoder.go
69
70 - name: Test Races, noasm, 1 cpu
71 env:
72 CGO_ENABLED: 1
73 run: go test -tags=noasm -cpu=1 -short -race -timeout 20m .
74
75 - name: Test Races, noasm, 4 cpu
76 env:
77 CGO_ENABLED: 1
78 run: go test -tags=noasm -cpu=4 -short -race -timeout 20m .
79
80 - name: Test Races, no gfni
81 env:
82 CGO_ENABLED: 1
83 run: go test -no-gfni -short -race
84
85 - name: Test Races, no avx512
86 env:
87 CGO_ENABLED: 1
88 run: go test -no-avx512 -short -race .
89
90 - name: Test Races, no avx512, no avx-gfni
91 env:
92 CGO_ENABLED: 1
93 run: go test -no-avx512 -no-avx-gfni -short -race .
94
95 - name: Test Races, no avx2
96 env:
97 CGO_ENABLED: 1
98 run: go test -no-avx512 -no-avx2 -short -race .
99
100 - name: Test Races, no ssse3
101 env:
102 CGO_ENABLED: 1
103 run: go test -no-avx512 -no-avx2 -no-ssse3 -short -race .
104
105 - name: Test Microarch v4
106 shell: bash {0}
107 run: go run testlevel.go 4;if [ $? -eq 0 ]; then GOAMD64=v4 go test -no-avx512 ./...; else true; fi
108
109 - name: Builds on ARM64
110 env:
111 GOOS: linux
112 GOARCH: arm64
113 run: go build .&&go build examples/simple-decoder.go&&go build examples/simple-encoder.go&&go build examples/stream-decoder.go&&go build examples/stream-encoder.go&&go build -tags=nopshufb .&&go build -tags=nopshufb examples/simple-decoder.go&&go build examples/simple-encoder.go&&go build -tags=nopshufb examples/stream-decoder.go&&go build examples/stream-encoder.go
114
115 - name: Build on PPC64LE
116 env:
117 GOOS: linux
118 GOARCH: ppc64le
119 run: go build .&&go build examples/simple-decoder.go&&go build examples/simple-encoder.go&&go build examples/stream-decoder.go&&go build examples/stream-encoder.go && go build -tags=nopshufb .&&go build -tags=nopshufb examples/simple-decoder.go&&go build examples/simple-encoder.go&&go build -tags=nopshufb examples/stream-decoder.go&&go build examples/stream-encoder.go
120
121 generate:
122 runs-on: ubuntu-latest
123 steps:
124 - name: Set up Go
125 uses: actions/setup-go@v2
126 with:
127 go-version: 1.26.x
128
129 - name: Checkout code
130 uses: actions/checkout@v2
131
132 - name: Generate
133 working-directory: ./_gen
134 run: go generate -v -x
135
136 - name: Git Status
137 run: |
138 git diff
139 test -z "$(git status --porcelain)"