github.com/netdata/go.d.plugin@v0.58.1/.github/workflows/test.yml (about) 1 on: 2 push: 3 branches: 4 - master 5 pull_request: null 6 7 name: Compile and test 8 jobs: 9 test: 10 strategy: 11 matrix: 12 go-version: [1.21.x] 13 platform: [ubuntu-latest] 14 runs-on: ${{ matrix.platform }} 15 steps: 16 - name: Install Go 17 uses: actions/setup-go@v5 18 with: 19 go-version: ${{ matrix.go-version }} 20 - name: Checkout 21 uses: actions/checkout@v4 22 - name: Go mod download 23 run: go mod download 24 - name: Compile 25 run: | 26 CGO_ENABLED=0 go build -o /tmp/godplugin github.com/netdata/go.d.plugin/cmd/godplugin/ 27 /tmp/godplugin --help || true 28 - name: Enforce formatted code 29 run: "! go fmt ./... 2>&1 | read -r" 30 - name: Go vet 31 run: go vet ./... 32 - name: Set up gotestfmt 33 uses: GoTestTools/gotestfmt-action@v2 34 with: 35 token: ${{ secrets.GITHUB_TOKEN }} 36 version: v2.0.0 37 - name: Go test 38 run: | 39 set -euo pipefail 40 go test -json ./... -race -count=1 2>&1 | gotestfmt -hide all