-
-
Notifications
You must be signed in to change notification settings - Fork 271
80 lines (76 loc) · 1.98 KB
/
build.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: build
on:
push:
branches:
- master
paths:
- 'go.mod'
- 'go.sum'
- '*.go'
- '*/*.go'
- '*/*/*.go'
- '*/*/*/*.go'
- '*/*/*/*/*.go'
- '*/*/*/*/*/*.go'
- '*/*/*/*/*/*/*.go'
- '*/*/*/*/*/*/*/*.go'
pull_request:
branches:
- master
paths:
- 'go.mod'
- 'go.sum'
- '*.go'
- '*/*.go'
- '*/*/*.go'
- '*/*/*/*.go'
- '*/*/*/*/*.go'
- '*/*/*/*/*/*.go'
- '*/*/*/*/*/*/*.go'
- '*/*/*/*/*/*/*/*.go'
jobs:
build:
runs-on: ubuntu-latest
env:
GO111MODULE: on
GOLANGCI_LINT_VERSION: v1.58.0
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.2
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Cache Go modules
uses: actions/cache@v4
id: cache-go-mod
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache bin directory
id: cache-go-bin
uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.os }}-go-bin-${{ env.GOLANGCI_LINT_VERSION }}
- name: Install tparse
if: steps.cache-go-bin.outputs.cache-hit != 'true'
run: go install github.com/mfridman/tparse
- name: Install golangci-lint
if: steps.cache-go-bin.outputs.cache-hit != 'true'
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $HOME/go/bin $GOLANGCI_LINT_VERSION
- name: Lint
run: $HOME/go/bin/golangci-lint run --timeout=2m ./...
- name: Test
run: go test -failfast -race -covermode=atomic -coverprofile=coverage.txt -cover -json ./... | $HOME/go/bin/tparse
build_docker_image:
name: Build Docker image from latest tag
runs-on: ubuntu-latest
steps:
- name: Build image
run: docker build https://github.com/bojand/ghz.git
env:
DOCKER_BUILDKIT: '1'