-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.03 KB
/
release.yml
File metadata and controls
49 lines (40 loc) · 1.03 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
name: Release Package
on:
push:
tags:
- v*
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.24']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.go-version }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Install dependencies
run: go mod tidy
- name: Build
run: go build ./...
- name: Run tests
run: go test -v ./...
- name: Check formatting
run: |
go fmt ./... | tee fmt.out
if test -s fmt.out; then
echo "Code is not properly formatted!"
exit 1
fi