-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 1.99 KB
/
ci.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: Build & Test
"on":
push:
branches:
- "*"
pull_request:
branches:
- "*"
schedule:
- cron: 01 13 * * SAT
jobs:
build:
name: Build & Test
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3b9b8c884f6b4bb4d5be2779c26374abadae0871
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version: stable
- uses: cue-lang/[email protected]
with:
version: latest
- uses: golangci/[email protected]
with:
version: latest
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/go/bin
~/go/pkg/mod
key: ${{ runner.os }}-go-tools-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-tools-
- name: Install Tools
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install mvdan.cc/gofumpt@latest
go install github.com/segmentio/golines@latest
go install github.com/incu6us/goimports-reviser/v3@latest
- name: Set GOVERSION environment variable (Linux/macOS)
if: runner.os != 'Windows'
run: echo "GOVERSION=$(go version)" >> $GITHUB_ENV
- name: Set GOVERSION environment variable (Windows)
if: runner.os == 'Windows'
run: echo "GOVERSION=$(go version)" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Build and Test
run: |
make build
make test
- name: Run GoReleaser
if: runner.os == 'Linux'
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf
with:
args: release --snapshot --skip=publish --clean
- name: Colored Output Test
if: runner.os == 'Linux'
shell: script -q -e -c "bash {0}"
run: go run main.go -- main.go