-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (49 loc) · 1.54 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
name: Go
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.18
- run: go version
- name: Checkout repository
uses: actions/checkout@v4
- name: Examine source code for Linux AMD
run: GOOS=linux GOARCH=amd64 go vet -v ./...
- name: Examine source code for MacOS AMD
run: GOOS=darwin GOARCH=amd64 go vet -v ./...
- name: Examine source code for Windows AMD
run: GOOS=windows GOARCH=amd64 go vet -v ./...
- name: Examine source code for Linux ARM
run: GOOS=linux GOARCH=arm64 go vet -v ./...
- name: Examine source code for MacOS ARM
run: GOOS=darwin GOARCH=arm64 go vet -v ./...
- name: Examine source code for Windows ARM
run: GOOS=windows GOARCH=arm64 go vet -v ./...
- name: Build
run: go build -v ./...
- name: Test
if: github.event_name == 'push'
run: go test -v -cover -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
if: github.event_name == 'push'
run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Update Go report card
if: github.event_name == 'push'
uses: creekorful/[email protected]