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:
14
.github/workflows/ci-cd.yml
vendored
14
.github/workflows/ci-cd.yml
vendored
@@ -28,6 +28,12 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Vet
|
||||||
|
run: /usr/local/go/bin/go vet ./src/...
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: /usr/local/go/bin/go test -v ./src/...
|
||||||
|
|
||||||
# build:
|
# build:
|
||||||
# name: Build binaries
|
# name: Build binaries
|
||||||
# runs-on: shell-ubuntu
|
# runs-on: shell-ubuntu
|
||||||
@@ -36,11 +42,11 @@ jobs:
|
|||||||
# - name: Checkout repo
|
# - name: Checkout repo
|
||||||
# run: git clone "${{ secrets.G_CLONE_URL }}" .
|
# run: git clone "${{ secrets.G_CLONE_URL }}" .
|
||||||
#
|
#
|
||||||
# - name: Build for 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 .
|
# 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
|
# - 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
|
# - name: Package binaries
|
||||||
# run: |
|
# run: |
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ RUN /usr/local/go/bin/go env -w GOPROXY=https://go.iranserver.com/repository/go/
|
|||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
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
|
# Runtime stage
|
||||||
FROM docker.iranserver.com/alpine:3.23
|
FROM docker.iranserver.com/alpine:3.23
|
||||||
|
|||||||
Reference in New Issue
Block a user