Set "min_version" for Pacemaker metrics newly added for v3.7. #1640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: go-build-and-test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add workloadagentplatform submodule | |
run: | | |
git submodule add https://github.com/GoogleCloudPlatform/workloadagentplatform | |
find workloadagentplatform/integration/common/shared/protos -type f -exec sed -i 's|"integration/common/shared/protos|"workloadagentplatform/integration/common/shared/protos|g' {} + | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.23.2' | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Install protoc-gen-go | |
run: | | |
go install github.com/golang/protobuf/protoc-gen-go@latest | |
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | |
- name: Compile protocol buffers | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
protoc --go_opt=paths=source_relative protos/**/*.proto workloadagentplatform/integration/common/shared/protos/**/*.proto --go_out=. | |
- name: Get the latest dependency versions | |
run: | | |
cp go.mod go.mod.orig | |
cp go.sum go.sum.orig | |
go clean -modcache | |
go mod tidy | |
echo "**************************** Latest go.mod dependencies ****************************" | |
cat go.mod | |
echo "**************************** Latest go.sum dependencies ****************************" | |
cat go.sum | |
echo "**************************** End of dependencies ****************************" | |
mv go.mod.orig go.mod | |
mv go.sum.orig go.sum | |
go clean -modcache | |
- name: Install dependencies in vendor mode | |
run: go mod vendor | |
- name: Build linux binary | |
run: env GOOS=linux GOARCH=amd64 go build -mod=vendor -v -o ../google_cloud_sap_agent | |
working-directory: cmd | |
- name: Build windows binary | |
run: env GOOS=windows GOARCH=amd64 go build -mod=vendor -v -o ../google_cloud_sap_agent | |
working-directory: cmd | |
- name: Test | |
run: go test -v ./... | |
- name: Notify on failure | |
if: ${{ failure() && contains(github.ref, 'main') }} | |
uses: cinotify/github-action@main | |
with: | |
to: '[email protected]' | |
subject: '[Failure] GitHub Agent for SAP build failure' | |
body: 'There was a failure for the GitHub Agent for SAP workflow action.\n\n https://github.com/GoogleCloudPlatform/sapagent/actions/runs/${{ github.run_id }}' |