run with toolexec

This commit is contained in:
grambbledook
2025-12-17 19:37:58 +01:00
parent a7d91b66e8
commit 539553f3ef
2 changed files with 21 additions and 15 deletions
@@ -21,25 +21,30 @@ jobs:
persist-credentials: false
path: gocacheplugin
- name: Checkout Go Cache Plugin - toolexec
uses: actions/checkout@v5
with:
repository: 'grafana/go-cache-plugin'
ref: grambbledook/toolexec
persist-credentials: false
path: gocacheplugin-toolexec
- name: Setup Go
uses: actions/setup-go@v6.0.0
with:
go-version-file: go.mod
cache: true
- name: Build foo
run: |
cd ./goinst
GOWORK=off go build -o foo
mv ./foo ../foo
cd ../
- name: Build Go Cache Plugin
run: |
cd ./gocacheplugin/cmd/go-cache-plugin
GOWORK=off go build -o go-cache-plugin
cd ../../..
cd ./gocacheplugin-toolexec/cmd/go-toolexec
GOWORK=off go build -o go-toolexec
cd ../../..
cp ./gocacheplugin/cmd/go-cache-plugin/go-cache-plugin ./
cp ./gocacheplugin-toolexec/cmd/go-toolexec/go-toolexec ./
- name: Start Go Cache Plugin
env:
@@ -66,6 +71,7 @@ jobs:
GOCACHE_DIR: /tmp/gocache
GOCACHE_ENABLE_TRACING: true
GOCACHE_TRACING_TRACE_FILE: trace-gocache.log
TOOLEXEC_TRACING_TRACE_FILE: trace-toolexec.log
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
@@ -73,15 +79,8 @@ jobs:
STEP_NAME: Build Grafana
STEP_NUMBER: 8
run: |
echo "RUN_ID=${GITHUB_RUN_ID}"
echo "RUN_ATTEMPT=${GITHUB_RUN_ATTEMPT}"
echo "GITHUB_JOB=${GITHUB_JOB}"
echo "STEP_NAME=Build Grafana"
ls ./
GOPROXY=http://localhost:5970/mod GOCACHEPROG="./go-cache-plugin connect 5930" make build-go
- name: Cleanup
run: |
kill $(cat go-cache-plugin.pid)
@@ -99,3 +98,10 @@ jobs:
cat trace-gocache.log
echo "=============================="
- name: Cat GOTOOLEXEC traces
run: |
echo "====GO GOTOOLEXEC TRACES====="
cat trace-toolexec.log
echo "============================="
+1 -1
View File
@@ -207,7 +207,7 @@ func doBuild(binaryName, pkg string, opts BuildOpts) error {
// We should not publish Grafana as a Go module, disabling vcs changes the version to (devel)
// and works better with SBOM and Vulnerability Scanners.
args = append(args, "-buildvcs=false")
//args = append(args, "-toolexec=\"./foo\"")
args = append(args, "-toolexec=\"./go-toolexec\"")
args = append(args, "-o", binary)
args = append(args, pkg)