-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.55 KB
/
ci.yml
File metadata and controls
50 lines (49 loc) · 1.55 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
code:
- '!**.md'
- '!docs/**'
- '!LICENSE'
- '!.gitignore'
- uses: actions/setup-go@v5
if: steps.filter.outputs.code == 'true'
with:
go-version: '1.25.5'
- name: Build with version info
if: steps.filter.outputs.code == 'true'
run: |
VERSION=$(cat VERSION)
GIT_HASH=$(git rev-parse --short HEAD)
BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
go build -ldflags "-s -w \
-X github.com/soapbucket/sbproxy/internal/version.Version=${VERSION} \
-X github.com/soapbucket/sbproxy/internal/version.BuildHash=${GIT_HASH} \
-X github.com/soapbucket/sbproxy/internal/version.BuildDate=${BUILD_DATE}" \
./...
- name: Vet
if: steps.filter.outputs.code == 'true'
run: go vet ./...
- name: Test
if: steps.filter.outputs.code == 'true'
run: go test ./... -count=1 -timeout 300s -race
- name: Install and run golangci-lint
if: steps.filter.outputs.code == 'true'
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run ./...
- name: Check
if: steps.filter.outputs.code == 'true'
run: make check