aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build-and-test.yaml
blob: ae93c55d3c7c38a2ab1990721347a4645b0ef006 (plain)
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
56
57
name: Build and test
on:
  workflow_dispatch:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  lint:
    name: Run linter before doing anything
    runs-on: ubuntu-latest
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@v3

      - name: Set up Go
        uses: actions/setup-go@v4
        with:
          go-version: 1.21.6
          cache: false

      - name: Vet
        run: go vet ./...

      - name: Check for CRLF endings
        uses: erclu/check-crlf@v1

      - name: Staticcheck
        uses: dominikh/[email protected]
        with:
          install-go: false
          version: "latest"

  test-nocache:
    strategy:
      matrix:
        go-version: [ 1.21.6 ]
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}

    name: test
    needs: lint
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@v3

      - name: Set up Go
        uses: actions/setup-go@v4
        with:
          go-version: 1.21.6
          cache: false

      - name: All tests
        run: go test -v ./...