-
Notifications
You must be signed in to change notification settings - Fork 181
88 lines (83 loc) · 2.38 KB
/
build.yml
File metadata and controls
88 lines (83 loc) · 2.38 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: Build
permissions:
contents: read
on:
push:
branches:
- main
- master
pull_request:
jobs:
setup:
name: Setup tools
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.tools-cache.outputs.cache-hit }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version: 1.23
- name: Tools cache
id: tools-cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
with:
path: |
~/go/bin
/usr/local/bin/promtool
key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }}
- name: Install CI dependencies
if: steps.tools-cache.outputs.cache-hit != 'true'
run: make install-ci-deps
lint-fmt:
name: Lint and Format
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version: 1.23
- name: Restore Tools cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
with:
path: |
~/go/bin
/usr/local/bin/promtool
key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }}
- name: Lint and Format
run: make lint-fmt
tests:
name: Run Tests
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version: 1.23
- name: Restore Tools cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
with:
path: |
~/go/bin
/usr/local/bin/promtool
key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }}
- name: Run Tests
run: make tests