Skip to content

Commit

Permalink
chore(ci): review of build flags, increase of runner storage (#2123)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaineK00n authored Feb 6, 2025
1 parent b6a8b55 commit 8987643
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 28 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 32768
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"

- name: Checkout
uses: actions/checkout@v4

Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 32768
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
-
name: Checkout
uses: actions/checkout@v4
Expand All @@ -20,13 +30,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
-
name: Clean space as per https://github.com/actions/virtual-environments/issues/709
run: |
sudo rm -rf "/opt/ghc" || true
sudo rm -rf "/usr/share/dotnet" || true
sudo rm -rf "/usr/local/lib/android" || true
sudo rm -rf "/usr/local/share/boost" || true
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
Expand Down
29 changes: 14 additions & 15 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ builds:
main: ./cmd/vuls/main.go
flags:
- -a
- -trimpath
ldflags:
- -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }}
binary: vuls
Expand All @@ -30,15 +31,14 @@ builds:
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
main: ./cmd/scanner/main.go
flags:
- -a
tags:
- scanner
flags:
- -a
- -trimpath
ldflags:
- -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }}
binary: vuls-scanner
Expand All @@ -51,13 +51,14 @@ builds:
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
main: ./contrib/trivy/cmd/main.go
tags:
- scanner
main: ./contrib/trivy/cmd/main.go
flags:
- -a
- -trimpath
ldflags:
- -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }}
binary: trivy-to-vuls
Expand All @@ -70,14 +71,13 @@ builds:
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
flags:
- -a
tags:
- scanner
flags:
- -a
- -trimpath
ldflags:
- -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }}
main: ./contrib/future-vuls/cmd/main.go
Expand All @@ -91,14 +91,13 @@ builds:
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
flags:
- -a
tags:
- scanner
flags:
- -a
- -trimpath
ldflags:
- -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }}
main: ./contrib/snmp2cpe/cmd/main.go
Expand Down
12 changes: 6 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ GO_WINDOWS := GOOS=windows GOARCH=amd64 $(GO)
all: build test

build: ./cmd/vuls/main.go
$(GO) build -a -ldflags "$(LDFLAGS)" -o vuls ./cmd/vuls
$(GO) build -a -trimpath -ldflags "$(LDFLAGS)" -o vuls ./cmd/vuls

build-windows: ./cmd/vuls/main.go
$(GO_WINDOWS) build -a -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/vuls
$(GO_WINDOWS) build -a -trimpath -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/vuls

install: ./cmd/vuls/main.go
$(GO) install -ldflags "$(LDFLAGS)" ./cmd/vuls
$(GO) install -a -trimpath -ldflags "$(LDFLAGS)" ./cmd/vuls

build-scanner: ./cmd/scanner/main.go
$(GO) build -tags=scanner -a -ldflags "$(LDFLAGS)" -o vuls ./cmd/scanner
$(GO) build -tags=scanner -a -trimpath -ldflags "$(LDFLAGS)" -o vuls ./cmd/scanner

build-scanner-windows: ./cmd/scanner/main.go
$(GO_WINDOWS) build -tags=scanner -a -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/scanner
$(GO_WINDOWS) build -tags=scanner -a -trimpath -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/scanner

install-scanner: ./cmd/scanner/main.go
$(GO) install -tags=scanner -ldflags "$(LDFLAGS)" ./cmd/scanner
$(GO) install -a -trimpath -tags=scanner -ldflags "$(LDFLAGS)" ./cmd/scanner

lint:
go install github.com/mgechev/revive@latest
Expand Down

0 comments on commit 8987643

Please sign in to comment.