-
Notifications
You must be signed in to change notification settings - Fork 36
102 lines (83 loc) · 2.12 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Continuous Integration
on:
push:
branches: '**'
pull_request:
- master
tags-ignore: '**'
jobs:
format:
strategy:
matrix:
os: [ 'ubuntu-latest' ]
go: [ '1.22' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: gofmt -l $(find . -type f -name '*.go') 2>&1
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: go generate
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
test:
strategy:
matrix:
os: [ 'macos-13', 'ubuntu-20.04', 'windows-2019' ]
go: [ '1.22' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: |
go generate
go test ./...
env:
CGO_ENABLED: 1
build:
strategy:
fail-fast: false
matrix:
target:
- os: 'macos-13'
goos: 'darwin'
goarch: 'amd64'
- os: 'macos-13'
goos: 'darwin'
goarch: 'arm64'
- os: 'ubuntu-20.04'
goos: 'linux'
goarch: 'amd64'
- os: 'windows-2019'
goos: 'windows'
goarch: 'amd64'
go: [ '1.22' ]
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- if: matrix.target.goos == 'darwin' && matrix.target.goarch == 'arm64'
run: |
echo SDKROOT=$(xcrun --sdk macosx --show-sdk-path) >> $GITHUB_ENV
- run: |
go generate
go build -v .
env:
GOOS: ${{ matrix.target.goos }}
GOARCH: ${{ matrix.target.goarch }}
CGO_ENABLED: 1
- uses: actions/upload-artifact@v4
with:
name: alpaca-${{ matrix.target.goos }}-${{ matrix.target.goarch }}
path: alpaca