-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 1.78 KB
/
build-and-test.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
81
name: Build and test
on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up Go
uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Run coverage
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... -coverpkg ./...
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
path: airbot
- name: Set up Go
uses: actions/[email protected]
with:
go-version-file: airbot/go.mod
cache-dependency-path: airbot/go.sum
- name: Build Docker image
uses: docker/[email protected]
with:
context: .
file: airbot/Dockerfile
push: false
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up Go
uses: actions/[email protected]
with:
go-version-file: go.mod
- name: Check format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: Lint
uses: golangci/[email protected]
with:
version: latest
args: "--timeout 3m"
- name: Vet
run: go vet
lint-markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Lint markdown
uses: DavidAnson/[email protected]