-
Notifications
You must be signed in to change notification settings - Fork 52
67 lines (57 loc) · 1.65 KB
/
build.yml
File metadata and controls
67 lines (57 loc) · 1.65 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
name: Go Build & Test
on:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: Build & Test
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Golang
uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Install etcd
if: runner.os == 'Linux'
run: |
curl -L https://github.com/etcd-io/etcd/releases/download/v3.5.18/etcd-v3.5.18-linux-amd64.tar.gz -o etcd-v3.5.18-linux-amd64.tar.gz
tar xzvf etcd-v3.5.18-linux-amd64.tar.gz
sudo mv etcd-v3.5.18-linux-amd64/etcd /usr/local/bin/
sudo mv etcd-v3.5.18-linux-amd64/etcdctl /usr/local/bin/
etcd --version
sudo apt install -y ncat
- name: Get dependencies
run: |
go mod download
go version
go generate ./...
go build
- name: GolangCI-Lint
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --verbose
- name: Test
run: |
go test -failfast -v -coverprofile profile.cov ./...
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
file: profile.cov
- name: Test E2E
if: runner.os == 'Linux'
run: |
sudo test/behaviour_test.sh
sudo rm -r default.etcd || true
- name: Run GoReleaser
if: runner.os == 'Linux'
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --snapshot --skip=publish --clean