Skip to content

Commit

Permalink
chore: update deps (#336)
Browse files Browse the repository at this point in the history
chore: update deps

Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 authored Sep 24, 2024
1 parent ba71bbe commit b2ab710
Show file tree
Hide file tree
Showing 10 changed files with 511 additions and 419 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
vault_version: ["1.11.12", "1.12.8", "1.13.4", "1.14.1"]

services:
vault:
image: hashicorp/vault:${{ matrix.vault_version }}
env:
SKIP_SETCAP: true
VAULT_DEV_ROOT_TOKEN_ID: 227e1cce-6bf7-30bb-2d2a-acc854318caf
ports:
- 8200:8200

steps:
- name: Checkout repository
Expand Down Expand Up @@ -122,7 +110,7 @@ jobs:
run: nix develop --impure .#ci

- name: Lint
run: nix develop --impure .#ci -c make lint
run: nix develop --impure .#ci -c make lint -j

license-check:
name: License check
Expand Down
11 changes: 10 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ linters-settings:
misspell:
locale: US
nolintlint:
allow-leading-space: false # require machine-readable nolint directives (with no leading space)
allow-unused: false # report any unused nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
revive:
confidence: 0

linters:
enable:
- bodyclose
- errcheck
- gci
- gofmt
- gofumpt
- goimports
- gosimple
- ineffassign
- misspell
- nolintlint
- revive
- unconvert
- unparam
- unused
- whitespace
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.5.0@sha256:0c6a569797744e45955f39d4f7538ac344bfb7ebf0a54006a0a4297b153ccf0f AS xx

FROM --platform=$BUILDPLATFORM golang:1.22.3-alpine3.18@sha256:d1a601b64de09e2fa38c95e55838961811d5ca11062a8f4230a5c434b3ae2a34 AS builder
FROM --platform=$BUILDPLATFORM golang:1.23.1-alpine3.20@sha256:ac67716dd016429be8d4c2c53a248d7bcdf06d34127d3dc451bda6aa5a87bc06 AS builder

COPY --from=xx / /

Expand Down
50 changes: 27 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ build: ## Build binary
@mkdir -p build
go build -race -o build/vault-env .

.PHONY: artifacts
artifacts: container-image binary-snapshot
artifacts: ## Build artifacts

.PHONY: container-image
container-image: ## Build container image
docker build .
Expand All @@ -37,14 +41,10 @@ container-image: ## Build container image
binary-snapshot: ## Build binary snapshot
VERSION=v${GORELEASER_VERSION} ${GORELEASER_BIN} release --clean --skip=publish --snapshot

.PHONY: artifacts
artifacts: container-image binary-snapshot
artifacts: ## Build artifacts

##@ Checks

.PHONY: check
check: test lint ## Run lint checks and tests
check: test lint ## Run tests lint checks

.PHONY: test
test: ## Run tests
Expand All @@ -56,7 +56,7 @@ lint: ## Run linters

.PHONY: lint-go
lint-go:
$(GOLANGCI_LINT_BIN) run $(if ${CI},--out-format github-actions,)
$(GOLANGCI_LINT_BIN) run $(if ${CI},--out-format colored-line-number,)

.PHONY: lint-docker
lint-docker:
Expand All @@ -66,25 +66,25 @@ lint-docker:
lint-yaml:
$(YAMLLINT_BIN) $(if ${CI},-f github,) --no-warnings .

.PHONY: fmt
fmt: ## Format code
$(GOLANGCI_LINT_BIN) run --fix

.PHONY: license-check
license-check: ## Run license check
$(LICENSEI_BIN) check
$(LICENSEI_BIN) header

.PHONY: fmt
fmt: ## Format code
$(GOLANGCI_LINT_BIN) run --fix

##@ Dependencies

deps: bin/golangci-lint bin/cosign bin/licensei bin/goreleaser
deps: ## Install dependencies

# Dependency versions
GOLANGCI_VERSION = 1.53.3
COSIGN_VERSION = 2.2.2
LICENSEI_VERSION = 0.8.0
GORELEASER_VERSION = 2.0.0
GOLANGCI_LINT_VERSION = 1.61.0
COSIGN_VERSION = 2.4.0
LICENSEI_VERSION = 0.9.0
GORELEASER_VERSION = 2.2.0

# Dependency binaries
GOLANGCI_LINT_BIN := golangci-lint
Expand All @@ -106,7 +106,7 @@ endif

bin/golangci-lint:
@mkdir -p bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- v${GOLANGCI_VERSION}
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- v${GOLANGCI_LINT_VERSION}

bin/licensei:
@mkdir -p bin
Expand All @@ -115,14 +115,18 @@ bin/licensei:
bin/cosign:
@mkdir -p bin
@OS=$$(uname -s); \
if [ "$$OS" = "Linux" ]; then \
curl -sSfL https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-amd64 -o bin/cosign; \
elif [ "$$OS" = "Darwin" ]; then \
curl -sSfL https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-darwin-arm64 -o bin/cosign; \
else \
echo "Unsupported OS"; \
exit 1; \
fi
case $$OS in \
"Linux") \
curl -sSfL https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-amd64 -o bin/cosign; \
;; \
"Darwin") \
curl -sSfL https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-darwin-arm64 -o bin/cosign; \
;; \
*) \
echo "Unsupported OS: $$OS"; \
exit 1; \
;; \
esac
@chmod +x bin/cosign


Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
vault:
image: hashicorp/vault:1.14.1
image: hashicorp/vault:1.14.8
ports:
- 127.0.0.1:8200:8200
environment:
Expand Down
Loading

0 comments on commit b2ab710

Please sign in to comment.