Skip to content

Commit

Permalink
Add build and test github action (#21)
Browse files Browse the repository at this point in the history
This will perform full build and test on PRs and
main branch builds and releases.
  • Loading branch information
tigrannajaryan authored Jan 24, 2025
1 parent 735eceb commit 46aac76
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build-and-test
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
GO111MODULE: "on"
CACHE_BENCHMARK: "off"
RUN_BASE_BENCHMARK: "on"
GO_VERSION: 1.22.x
jobs:
build:
strategy:
matrix:
go-version: [ 1.22.x ]
runs-on: ubuntu-latest
steps:
- name: Install Go stable
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v4

- name: Go cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}

- name: Restore benchstat
uses: actions/cache@v4
with:
path: ~/go/bin/benchstat
key: ${{ runner.os }}-benchstat-legacy

- name: Build and test
run: |
make build-ci
11 changes: 11 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ default:
cd otelcol && make
cd benchmarks && make

.PHONY: all
all:
cd stefgen && make all
cd go/pkg && make all
Expand All @@ -24,6 +25,16 @@ all:
cd otelcol && make all
cd benchmarks && make all

.PHONY: build-ci
build-ci:
cd stefgen && make all
cd go/pkg && make all
cd go/grpc && make
cd go/otel && make all
cd go/pdata && make all
cd otelcol && make all
cd benchmarks && make all

.PHONY: verifyver
verifyver:
ifndef VERSION
Expand Down

0 comments on commit 46aac76

Please sign in to comment.