-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (54 loc) · 1.58 KB
/
go.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
name: Go
on:
push:
paths-ignore:
- '**.md'
jobs:
build:
name: 📦 Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Build
run: go build
- name: Test
run: go test -coverpkg='./internal/...' -v './...'
- name: Vet
run: go vet ./...
- name: Run coverage
run: go test -coverpkg='./internal/...' -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
release:
name: 🚀 Release
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21'
- run: go build
- uses: go-semantic-release/action@v1
with:
hooks: goreleaser
prerelease: false
allow-initial-development-versions: true # remove to trigger an initial 1.0.0 release
changelog-generator-opt: "emojis=true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}