-
Notifications
You must be signed in to change notification settings - Fork 15
85 lines (73 loc) · 2.13 KB
/
ci.yaml
File metadata and controls
85 lines (73 loc) · 2.13 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
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
schedule:
- cron: '15 22 * * *'
workflow_dispatch: {} # support manual runs
permissions:
contents: read
jobs:
ci:
name: "Tests and Benchmarks"
strategy:
matrix:
# We use macos here because those are the only ARM runners available
# to private repositories.
os: [ubuntu-latest, macos-15]
mode: [fast, debug, race, unopt]
go-version: [1.24.x, 1.25.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v5
with: {fetch-depth: 1}
- name: Install Go
uses: actions/setup-go@v5
with: {go-version: "${{ matrix.go-version }}"}
- name: Cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: "${{ runner.os }}-hyperpb-ci-${{ hashFiles('**/go.sum') }}"
restore-keys: "${{ runner.os }}-hyperpb-ci-"
- name: Check Generated Files
if: ${{ matrix.mode == 'fast' }}
run: |
make generate
make checkgenerate
- name: Test
if: ${{ matrix.mode == 'fast' }}
run: make test
- name: Test Debug
if: ${{ matrix.mode == 'debug' }}
run: make test TAGS=debug
- name: Test Race
if: ${{ matrix.mode == 'race' }}
run: make test HYPERTESTFLAGS=-race
# TODO(#30): Remove one this is fixed.
- name: Test Unoptimized
if: ${{ matrix.mode == 'unopt' }}
run: make test HYPERTESTFLAGS=-unopt
- name: Benchmark
if: ${{ matrix.mode == 'fast' }}
run: make bench BENCHMARK="B/^descriptor.yaml"
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.24.x, 1.25.x]
steps:
- name: Checkout Code
uses: actions/checkout@v5
with: {fetch-depth: 1}
- name: Install Go
uses: actions/setup-go@v5
with: {go-version: "${{ matrix.go-version }}"}
- name: Lint
uses: golangci/golangci-lint-action@v8
with: {version: v2.4.0} # Keep in sync with the Makefile.