forked from thanos-community/thanos-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (77 loc) · 2.04 KB
/
go.yml
File metadata and controls
84 lines (77 loc) · 2.04 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
name: go
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
env:
golang-version: '1.25'
kind-version: 'v0.30.0'
permissions:
contents: read
pull-requests: read
jobs:
lint:
runs-on: ubuntu-latest
name: Linters (Static Analysis) for Go
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.golang-version }}
- uses: actions/cache@v5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Linting & vetting.
env:
GOBIN: /tmp/.bin
run: make lint
unit-tests:
runs-on: ubuntu-latest
name: Unit tests
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: ${{ env.golang-version }}
- run: make --always-make test
e2e-tests:
name: E2E tests (Thanos ${{ matrix.thanos-version }}) (${{ matrix.kind-image }})
runs-on: ubuntu-latest
strategy:
matrix:
kind-image: ['kindest/node:v1.34.0']
thanos-version:
- v0.39.0
- v0.40.1
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: ${{ env.golang-version }}
- name: Start kind cluster
uses: helm/kind-action@v1.13.0
with:
version: ${{ env.kind-version }}
node_image: ${{ matrix.kind-image }}
wait: 10s
cluster_name: kind
- name: Wait for cluster to bootstrap
run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
- name: Run tests
run: |
export KUBECONFIG="${HOME}/.kube/config"
THANOS_VERSION=${{ matrix.thanos-version }} make test-e2e