ci: fix host-mode docker go invocation
All checks were successful
CI / Test, vet, build (push) Successful in 51s
All checks were successful
CI / Test, vet, build (push) Successful in 51s
This commit is contained in:
parent
4ab64d501e
commit
71c0d89102
3 changed files with 39 additions and 60 deletions
|
|
@ -1,4 +1,3 @@
|
|||
# Host-mode runner: Go via official image.
|
||||
name: CI
|
||||
|
||||
on:
|
||||
|
|
@ -22,20 +21,11 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
case "$GITHUB_WORKSPACE" in
|
||||
/data/*) HOST_WORKSPACE="/opt/forgejo-runner/data${GITHUB_WORKSPACE#/data}" ;;
|
||||
*) HOST_WORKSPACE="$GITHUB_WORKSPACE" ;;
|
||||
/data/*) HOST_WS="/opt/forgejo-runner/data${GITHUB_WORKSPACE#/data}" ;;
|
||||
*) HOST_WS="$GITHUB_WORKSPACE" ;;
|
||||
esac
|
||||
test -f "$GITHUB_WORKSPACE/go.mod"
|
||||
docker run --rm --network host \
|
||||
--volume "$HOST_WORKSPACE:/src" \
|
||||
--workdir /src \
|
||||
-e CGO_ENABLED=0 \
|
||||
-v "${HOST_WS}:/src" -w /src -e CGO_ENABLED=0 \
|
||||
golang:1.25-bookworm \
|
||||
bash -lc '
|
||||
set -euo pipefail
|
||||
go version
|
||||
go test -count=1 ./...
|
||||
go vet ./...
|
||||
make build
|
||||
ls -la bin/tarakan
|
||||
'
|
||||
sh -c "go version && go test -count=1 ./... && go vet ./... && make build && ls -la bin/tarakan"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue