-
Notifications
You must be signed in to change notification settings - Fork 18
49 lines (42 loc) · 1.08 KB
/
main.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
name: Build and Test
on:
# Run on mainline branches
push:
branches:
- 'master'
- 'release-*'
# Run on branch/tag creation
create:
# Run on Pull Requests
pull_request:
jobs:
build:
name: Build and Test
strategy:
matrix:
go: [1.19.x, 1.20.x]
os: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
- name: Check gofmt
run: diff -u <(echo -n) <(gofmt -d .)
if: matrix.os != 'windows-latest'
- name: Run go vet
run: go vet $(go list ./... | grep -v /vendor/)
- name: Build
run: go build -v .
- name: Test
run: go test -v -race ./...
# Load artifacts obtained with the most recent version of Go
- name: Upload build artifacts
uses: actions/upload-artifact@v3
if: matrix.go == '1.20.x'
with:
path: astartectl*
name: astartectl-snapshot-${{ matrix.os }}