diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 8454c49..efda534 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -9,11 +9,6 @@ jobs: - name: Check out repo uses: actions/checkout@v4 - - name: Run unit tests - run: | - docker run --rm -v "$PWD:/src" -w /src golang:1.26-alpine \ - sh -c "go test ./..." - - name: Log in to Gitea registry uses: docker/login-action@v3 with: diff --git a/Dockerfile b/Dockerfile index bd24ba2..e2b2c26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ RUN go mod download COPY cmd/ ./cmd/ COPY pkg/ ./pkg/ +# Tests run inside the build container — Gitea/act DinD makes mount-based +# `docker run -v $PWD:/src` unreliable for native go test from the runner job. +RUN go test -count=1 ./... + ARG GIT_SHA=unknown RUN CGO_ENABLED=0 go build -trimpath \ -ldflags="-s -w -X main.gitSHA=${GIT_SHA}" \