-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.67 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: ci
env:
GOLANGCI_LINT_VERSION: '1.59.1'
GORELEASER_VERSION: '1.26.2'
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths:
- '**.go'
- '!pkg/version/release.go'
- go.mod
- go.sum
pull_request:
paths:
- '**.go'
- '!pkg/version/release.go'
- go.mod
- go.sum
workflow_dispatch: {}
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install golangci-lint
run: |
wget -q https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz
tar -xzf golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz
mv golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint /home/runner/go/bin/golangci-lint-v${GOLANGCI_LINT_VERSION}
- name: Install GoReleaser
run: |
wget -q https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_Linux_x86_64.tar.gz
tar -xzf goreleaser_Linux_x86_64.tar.gz
mv goreleaser /home/runner/go/bin/goreleaser-v${GORELEASER_VERSION}
- name: Run lint
run: make lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Run test
run: make test