-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.2 KB
/
agentv2-build-test.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
name: Build and test Cluster Agent v2
on:
pull_request:
branches:
- main
paths:
- v2/**
- .github/workflows/agentv2-build-test.yml
- 'charts/ror-cluster-agent-v2/**'
env:
APP: agent
APP_PATH: cmd/agent
jobs:
build-app:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Test
run: |
echo testing...
cd v2
go get -t ./...
go vet ./...
go test -v ./...
- name: Build
run: |
echo building v2...
cd v2
export SHA_SHORT=$(git rev-parse --short HEAD)
export LIB_VER=$(cat go.mod | grep "github.com/NorskHelsenett/ror " | cut -d' ' -f2)
go get ./...
CGO_ENABLED=0 go build -o dist/${{ env.APP }} -ldflags "-w -extldflags '-static' -X github.com/NorskHelsenett/ror/pkg/config/rorversion.Version=$ROR_VERSION -X github.com/NorskHelsenett/ror/pkg/config/rorversion.Commit=$SHA_SHORT -X github.com/NorskHelsenett/ror/pkg/config/rorversion.LibVer=$LIB_VER" ${{ env.APP_PATH }}/main.go
env:
ROR_VERSION: v0.0.1-build