Fetch metadata about volume mounts in Deployment yaml #1655
Workflow file for this run
This file contains hidden or 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 config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| git submodule add https://github.com/GoogleCloudPlatform/workloadagentplatform | |
| cd workloadagentplatform | |
| # this is the hash of the workloadagentplatform submodule | |
| # get the hash by running: go list -m -json github.com/GoogleCloudPlatform/workloadagentplatform@main | |
| git checkout d9a9b45e4977c3237989311ee6b5e7103796f677 | |
| cd .. | |
| find workloadagentplatform/sharedprotos -type f -exec sed -i 's|"sharedprotos|"workloadagentplatform/sharedprotos|g' {} + | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: '1.24.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/sharedprotos/**/*.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_workload_agent | |
| working-directory: cmd | |
| - name: Build windows binary | |
| run: env GOOS=windows GOARCH=amd64 go build -mod=vendor -v -o ../google_cloud_workload_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: 'workload-agent-github-dev@google.com' | |
| subject: '[Failure] GitHub Workload Agent build failure' | |
| body: 'There was a failure for the GitHub Workload Agent workflow action.\n\n https://github.com/GoogleCloudPlatform/workloadagent/actions/runs/${{ github.run_id }}' |