-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 1.95 KB
/
go.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
name: Go OVP8xx package
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.57
test:
runs-on: ubuntu-latest
needs: lint
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v3
with:
lfs: 'true'
- name: 👷 Prepare the Go environment
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: 🧪 Run the unit tests
run: go test -v -failfast -coverprofile cover.out -timeout=1m ./...
- name: 🚀 Upload the coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install dependencies
run: go get -d ./...
- name: Build
run: go build -v ./...
- name: Build the CLI
run: go build cmd/ovp8xx/ovp8xx.go
release:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
- uses: go-semantic-release/action@v1
with:
hooks: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}