-
Notifications
You must be signed in to change notification settings - Fork 21
126 lines (104 loc) · 3.38 KB
/
test.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4
with:
go-version-file: ./go.mod
- name: setup task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Builds the binary into the bin/ directory
- name: build
run: |-
task build
- name: upload artifact
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: frizbee
path: bin/frizbee
cover:
name: Coverage
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4
with:
go-version-file: 'go.mod'
- name: setup task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run coverage
run: task cover
# Using gcov didn't seem to work for the coveralls app, so we convert it to lcov
- name: Try converting to LCOV
run: go run github.com/jandelgado/gcov2lcov@latest -infile=./coverage.out -outfile=./coverage.lcov
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4
with:
go-version-file: ./go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v3
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4
with:
go-version-file: ./go.mod
- name: setup task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: test
run: |-
task test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Checks that the github workflows are valid using this same tool
frizbee:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: download artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
with:
name: frizbee
path: bin/
- name: Make frizbee executable
run: |-
chmod +x bin/frizbee
- name: Frizbee
run: |-
bin/frizbee actions --dry-run --error
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}