Debian Codegraph @

.github/workflows/linux.yml

raw
1 name: Linux
2
3 on:
4 push:
5 branches:
6 - main
7 pull_request:
8 branches:
9 - '*'
10
11 jobs:
12 build:
13 strategy:
14 matrix:
15 # Oldest we support is 1.18, plus the latest two releases.
16 go-version: ['1.18', '1.20', '1.21']
17 runs-on: ubuntu-latest
18
19 steps:
20 - name: Set up Go
21 uses: actions/setup-go@v2
22 with:
23 go-version: ${{ matrix.go-version }}
24 id: go
25
26 - name: Check out code into the Go module directory
27 uses: actions/checkout@v3
28
29 - name: Check Go modules
30 if: matrix.go-version == '1.21'
31 run: |
32 go mod tidy
33 git diff --exit-code
34
35 - name: Check formatting
36 if: matrix.go-version == '1.21'
37 run: diff -u <(echo -n) <(gofmt -d .)
38
39 - name: Run tests on linux
40 run: go test ./...