Skip to content

Commit 46aac76

Browse files
Add build and test github action (#21)
This will perform full build and test on PRs and main branch builds and releases.
1 parent 735eceb commit 46aac76

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build-and-test
2+
on:
3+
push:
4+
branches: [main]
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+*"
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
env:
14+
GO111MODULE: "on"
15+
CACHE_BENCHMARK: "off"
16+
RUN_BASE_BENCHMARK: "on"
17+
GO_VERSION: 1.22.x
18+
jobs:
19+
build:
20+
strategy:
21+
matrix:
22+
go-version: [ 1.22.x ]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Install Go stable
26+
uses: actions/setup-go@v4
27+
with:
28+
go-version: ${{ matrix.go-version }}
29+
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Go cache
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/go/pkg/mod
38+
~/.cache/go-build
39+
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
40+
41+
- name: Restore benchstat
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/go/bin/benchstat
45+
key: ${{ runner.os }}-benchstat-legacy
46+
47+
- name: Build and test
48+
run: |
49+
make build-ci

makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ default:
1515
cd otelcol && make
1616
cd benchmarks && make
1717

18+
.PHONY: all
1819
all:
1920
cd stefgen && make all
2021
cd go/pkg && make all
@@ -24,6 +25,16 @@ all:
2425
cd otelcol && make all
2526
cd benchmarks && make all
2627

28+
.PHONY: build-ci
29+
build-ci:
30+
cd stefgen && make all
31+
cd go/pkg && make all
32+
cd go/grpc && make
33+
cd go/otel && make all
34+
cd go/pdata && make all
35+
cd otelcol && make all
36+
cd benchmarks && make all
37+
2738
.PHONY: verifyver
2839
verifyver:
2940
ifndef VERSION

0 commit comments

Comments
 (0)