Skip to content

Commit

Permalink
fix: correct go version and run tests in dockerfile (#48)
Browse files Browse the repository at this point in the history
* fix: correct go version in dockerfile

* ci: run build and push image on PRs

* run go test command

* readme: show the build badge instead of lint
  • Loading branch information
scriptnull authored Dec 21, 2024
1 parent 8d4a880 commit 376f71d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build the Go binary using Alpine
FROM golang:1.22-alpine AS builder
FROM golang:1.23-alpine AS builder

# Ensure the build fails on any command failure
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
Expand All @@ -19,6 +19,9 @@ RUN go mod tidy
# Copy the source code
COPY . .

# Run the tests
RUN go test -v ./...

# Build the Go binary for amd64
RUN GOARCH=amd64 go build -o gokakashi

Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gokakashi - The Centralized Image Vulnerability Platform πŸ”πŸš€

[![golangci-lint](https://github.com/gokakashi/gokakashi/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/gokakashi/gokakashi/actions/workflows/lint.yml)
[![Build](https://github.com/shinobistack/gokakashi/actions/workflows/build.yml/badge.svg)](https://github.com/shinobistack/gokakashi/actions/workflows/build.yml)

🚧 Heavy work in progress 🚧

Expand Down

0 comments on commit 376f71d

Please sign in to comment.