-
Notifications
You must be signed in to change notification settings - Fork 91
111 lines (108 loc) · 3.8 KB
/
checks.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Checks
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
env:
GO_VERSION: "~1.23.1"
jobs:
check-links:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 # v2.2.0
with:
args: >-
-v -n "*.md" "**/*.md"
--exclude "http://localhost*"
fail: true
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache-dependency-path: "**/go.sum"
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Module cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: go-mod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
- name: Tools cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: go-tools-cache
with:
path: ~/.tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev
- name: Run linters
run: make license-header-check go-mod-tidy golangci-lint
- name: Check clean repository
run: make check-clean-work-tree
race-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: "**/go.sum"
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang llvm
- name: Run tests
run: make test-race
compatibility-test:
strategy:
matrix:
go-version: ["~1.23.1", "~1.22.7"]
os: [ubuntu-latest]
# GitHub Actions does not support arm* architectures on default
# runners. It is possible to accomplish this with a self-hosted runner
# if we want to add this in the future:
# https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
arch: [amd64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: "**/go.sum"
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang llvm
- name: Run tests
env:
GOARCH: ${{ matrix.arch }}
run: make test
verify-licenses:
runs-on: ubuntu-24.04
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache-dependency-path: "**/go.sum"
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev
- run: make verify-licenses