-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.2 KB
/
build.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
name: Build
on:
push:
branches: ['*']
tags: ['v*']
pull_request:
branches: ['*']
jobs:
build:
name: Build
timeout-minutes: 5
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Load cached dependencies
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Download dependencies
run: make setup
- name: Run linter
run: make lint
- name: Run unit tests
run: make clean cover
- name: Upload coverage to coveralls.io
if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.22.x'
uses: coverallsapp/github-action@v2
with:
file: cover.out
flag-name: ${{ runner.os }}-go-${{ matrix.go-version }}
fail-on-error: false