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 jobs:
10 formatting:
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v7
14
15 - name: Setup Go
16 uses: actions/setup-go@v7
17 with:
18 go-version-file: go.mod
19
20 - name: Check formatting
21 run: go fmt && git diff --exit-code
22
23 tests:
24 runs-on: ${{ matrix.os }}
25 strategy:
26 matrix:
27 os: [ubuntu-latest, windows-latest]
28 steps:
29 - uses: actions/checkout@v7
30
31 - name: Setup Go
32 uses: actions/setup-go@v7
33 with:
34 go-version-file: go.mod
35
36 - name: Build
37 run: go build -v ./...
38
39 - name: Test
40 run: go test -v ./...
41
42 - name: golangci-lint
43 uses: golangci/golangci-lint-action@v9
44 with:
45 version: v2.5.0
46
47 build:
48 runs-on: ubuntu-latest
49 strategy:
50 matrix:
51 include:
52 - { os: android, arch: arm64 }
53 - { os: darwin, arch: amd64 }
54 - { os: darwin, arch: arm64 }
55 - { os: dragonfly, arch: amd64 }
56 - { os: freebsd, arch: "386" }
57 - { os: freebsd, arch: amd64 }
58 - { os: freebsd, arch: arm }
59 - { os: illumos, arch: amd64 }
60 - { os: linux, arch: "386" }
61 - { os: linux, arch: amd64 }
62 - { os: linux, arch: arm }
63 - { os: linux, arch: arm64 }
64 - { os: linux, arch: ppc64 }
65 - { os: linux, arch: ppc64le }
66 - { os: linux, arch: mips }
67 - { os: linux, arch: mipsle }
68 - { os: linux, arch: mips64 }
69 - { os: linux, arch: mips64le }
70 - { os: linux, arch: s390x }
71 - { os: netbsd, arch: "386" }
72 - { os: netbsd, arch: amd64 }
73 - { os: netbsd, arch: arm }
74 - { os: openbsd, arch: "386" }
75 - { os: openbsd, arch: amd64 }
76 - { os: openbsd, arch: arm }
77 - { os: openbsd, arch: arm64 }
78 - { os: solaris, arch: amd64 }
79 - { os: windows, arch: "386" }
80 - { os: windows, arch: amd64 }
81 # Unsupported
82 # - { os: aix, arch: ppc64 }
83 # - { os: android, arch: "386" }
84 # - { os: android, arch: amd64 }
85 # - { os: android, arch: arm }
86 # - { os: js, arch: wasm }
87 # - { os: plan9, arch: "386" }
88 # - { os: plan9, arch: amd64 }
89 # - { os: plan9, arch: arm }
90 steps:
91 - uses: actions/checkout@v7
92 with:
93 fetch-depth: 0 # https://github.com/actions/checkout/issues/2199
94 fetch-tags: true
95
96 - name: Setup Go
97 uses: actions/setup-go@v7
98 with:
99 go-version-file: go.mod
100
101 - name: Build
102 run: gen/build.sh
103 env:
104 GOOS: ${{ matrix.os }}
105 GOARCH: ${{ matrix.arch }}