ci: add vet and test steps, fix build targets to src directory

- Add go vet and go test steps to CI workflow
- Update Dockerfile and CI build commands to target ./src
- Comment out build jobs for Linux and Windows
- Fix build paths across the workflow configuration
This commit is contained in:
db123-test
2026-05-05 11:56:55 +03:30
parent 8d25bda386
commit 62e66f0436
2 changed files with 11 additions and 5 deletions

View File

@@ -28,6 +28,12 @@ jobs:
exit 1
fi
- name: Vet
run: /usr/local/go/bin/go vet ./src/...
- name: Run tests
run: /usr/local/go/bin/go test -v ./src/...
# build:
# name: Build binaries
# runs-on: shell-ubuntu
@@ -36,11 +42,11 @@ jobs:
# - name: Checkout repo
# run: git clone "${{ secrets.G_CLONE_URL }}" .
#
# - name: Build for Linux amd64
# run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-linux-amd64 .
#
# - name: Build for Linux amd64
# run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-linux-amd64 ./src
# - name: Build for Windows amd64
# run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-windows-amd64.exe
# run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-windows-amd64.exe ./src
#
# - name: Package binaries
# run: |

View File

@@ -13,7 +13,7 @@ RUN /usr/local/go/bin/go env -w GOPROXY=https://go.iranserver.com/repository/go/
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o auth-proxy .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o auth-proxy ./src
# Runtime stage
FROM docker.iranserver.com/alpine:3.23