-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.66 KB
/
Copy pathci.yaml
File metadata and controls
70 lines (60 loc) · 1.66 KB
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
name: CI
on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '*.md'
- 'LICENSE'
pull_request:
branches: [main]
jobs:
check:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Go vet
run: go vet ./...
- name: Go test
run: go test -race ./...
- name: Go build
run: CGO_ENABLED=0 go build -trimpath ./cmd/diffkit
cross-compile:
name: Cross-Compile (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: check
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -trimpath -ldflags "-s -w" -o diffkit-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/diffkit
tar czf diffkit-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz diffkit-${{ matrix.goos }}-${{ matrix.goarch }}
- uses: actions/upload-artifact@v4
with:
name: diffkit-${{ matrix.goos }}-${{ matrix.goarch }}
path: diffkit-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz