Skip to content

Commit b4cd1be

Browse files
committed
test in action instead of in Dockerfile
1 parent 416b936 commit b4cd1be

2 files changed

Lines changed: 61 additions & 53 deletions

File tree

.github/workflows/docker-image-testing.yaml

Lines changed: 61 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -22,59 +22,68 @@ jobs:
2222
with:
2323
args: ./...
2424

25-
- name: Install Cosign
26-
uses: sigstore/cosign-installer@v3.9.2
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
2727
with:
28-
cosign-release: 'v2.5.3'
28+
go-version: '1.24.5'
2929

30-
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@v3
30+
- name: Run Go tests
31+
run: go test ./...
3232

33-
- name: Login to Docker Hub
34-
uses: docker/login-action@v3
35-
with:
36-
username: ${{ secrets.DOCKERHUB_USERNAME }}
37-
password: ${{ secrets.DOCKERHUB_TOKEN }}
38-
39-
- name: Login to GitHub Container Registry
40-
uses: docker/login-action@v3
41-
with:
42-
registry: ghcr.io
43-
username: ${{ github.actor }}
44-
password: ${{ secrets.GITHUB_TOKEN }}
45-
46-
- name: Build and push Docker Hub image
47-
uses: docker/build-push-action@v5
48-
id: push-dockerhub
49-
with:
50-
context: .
51-
platforms: linux/amd64,linux/arm/v7,linux/arm64
52-
push: true
53-
build-args: VERSION=testing-${{ github.sha }}
54-
tags: |
55-
docker.io/wollomatic/socket-proxy:testing
56-
docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}
57-
58-
- name: Sign Docker Hub image
59-
run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.push-dockerhub.outputs.digest }}
60-
env:
61-
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
62-
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
63-
64-
- name: Build and push GHCR image
65-
uses: docker/build-push-action@v5
66-
id: push-ghcr
67-
with:
68-
context: .
69-
platforms: linux/amd64,linux/arm/v7,linux/arm64
70-
push: true
71-
build-args: VERSION=testing-${{ github.sha }}
72-
tags: |
73-
ghcr.io/wollomatic/socket-proxy:testing
74-
ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}
7533

76-
- name: Sign GHCR image
77-
run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.push-ghcr.outputs.digest }}
78-
env:
79-
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
80-
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
34+
# - name: Install Cosign
35+
# uses: sigstore/cosign-installer@v3.9.2
36+
# with:
37+
# cosign-release: 'v2.5.3'
38+
#
39+
# - name: Set up Docker Buildx
40+
# uses: docker/setup-buildx-action@v3
41+
#
42+
# - name: Login to Docker Hub
43+
# uses: docker/login-action@v3
44+
# with:
45+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
46+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
47+
#
48+
# - name: Login to GitHub Container Registry
49+
# uses: docker/login-action@v3
50+
# with:
51+
# registry: ghcr.io
52+
# username: ${{ github.actor }}
53+
# password: ${{ secrets.GITHUB_TOKEN }}
54+
#
55+
# - name: Build and push Docker Hub image
56+
# uses: docker/build-push-action@v5
57+
# id: push-dockerhub
58+
# with:
59+
# context: .
60+
# platforms: linux/amd64,linux/arm/v7,linux/arm64
61+
# push: true
62+
# build-args: VERSION=testing-${{ github.sha }}
63+
# tags: |
64+
# docker.io/wollomatic/socket-proxy:testing
65+
# docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}
66+
#
67+
# - name: Sign Docker Hub image
68+
# run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.push-dockerhub.outputs.digest }}
69+
# env:
70+
# COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
71+
# COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
72+
#
73+
# - name: Build and push GHCR image
74+
# uses: docker/build-push-action@v5
75+
# id: push-ghcr
76+
# with:
77+
# context: .
78+
# platforms: linux/amd64,linux/arm/v7,linux/arm64
79+
# push: true
80+
# build-args: VERSION=testing-${{ github.sha }}
81+
# tags: |
82+
# ghcr.io/wollomatic/socket-proxy:testing
83+
# ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}
84+
#
85+
# - name: Sign GHCR image
86+
# run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.push-ghcr.outputs.digest }}
87+
# env:
88+
# COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
89+
# COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ COPY . ./
55
ARG TARGETOS
66
ARG TARGETARCH
77
ARG VERSION
8-
RUN go test ./...
98
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
109
go build -tags=netgo -gcflags=all=-d=checkptr -ldflags="-w -s -X 'main.version=${VERSION}'" -trimpath \
1110
-o / ./...

0 commit comments

Comments
 (0)