Compare commits

...

4 Commits

Author SHA1 Message Date
f584508d63
chore(deps): update dependency go to v1.24.4
All checks were successful
Golang Tests / unittest (stable, ubuntu-latest-arm64) (pull_request) Successful in 1m12s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (pull_request) Successful in 1m21s
Lint Markdown files / markdown-lint (pull_request) Successful in 11s
Golang Tests / unittest (stable, ubuntu-latest-amd64) (pull_request) Successful in 2m28s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (pull_request) Successful in 3m13s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 1m12s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Successful in 1m18s
Lint Markdown files / markdown-lint (push) Successful in 13s
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 4m5s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Successful in 2m47s
2025-06-05 19:03:48 +00:00
f0955bc835
fix: extend error handling
All checks were successful
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 8s
Lint Markdown files / markdown-lint (push) Successful in 4s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Successful in 2m31s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 45s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Successful in 1m50s
2025-06-01 13:47:15 +02:00
17695e0996
chore(ci): use DavidAnson/markdownlint-cli2-action@v19.1.0
Some checks failed
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 8s
Lint Markdown files / markdown-lint (push) Successful in 4s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 40s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Failing after 1m26s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Failing after 2m19s
2025-06-01 13:37:49 +02:00
e473009b6e
chore(ci): add golangci-lint
Some checks failed
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 33s
Markdown linter / markdown-lint (push) Successful in 3s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Failing after 2m34s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 3m42s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Failing after 1m54s
2025-06-01 12:18:37 +02:00
7 changed files with 49 additions and 21 deletions

View File

@ -9,13 +9,16 @@ on:
jobs: jobs:
unittest: unittest:
runs-on: runs-on: ${{ matrix.os }}
- ubuntu-latest strategy:
matrix:
go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0 - uses: actions/setup-go@v5.5.0
with: with:
go-version: stable go-version: ${{ matrix.go }}
- env: - env:
GOPROXY: ${{ vars.GOPROXY }} GOPROXY: ${{ vars.GOPROXY }}
run: make test/unit run: make test/unit

View File

@ -0,0 +1,27 @@
name: Golang CI lint
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
permissions:
contents: read
jobs:
golangci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go }}
- uses: golangci/golangci-lint-action@v8.0.0
with:
version: v2.1

View File

@ -1,20 +1,18 @@
name: Markdown linter name: 'Lint Markdown files'
on: on:
pull_request: pull_request:
types: [ "opened", "reopened", "synchronize" ] types: [ "opened", "reopened", "synchronize" ]
push: push:
branches: [ '**' ] branches: [ '*' ]
tags-ignore: [ '**' ] tags-ignore: [ '*' ]
workflow_dispatch: {}
jobs: jobs:
markdown-lint: markdown-lint:
container:
image: git.cryptic.systems/volker.raschek/markdownlint:0.45.0
runs-on: runs-on:
- ubuntu-latest - ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v4.2.2
- name: Lint Markdown files - uses: DavidAnson/markdownlint-cli2-action@v19.1.0
run: markdownlint --config .markdownlint.yaml . with:
globs: '**/*.md'

2
go.mod
View File

@ -2,7 +2,7 @@ module git.cryptic.systems/volker.raschek/civ
go 1.24 go 1.24
toolchain go1.24.3 toolchain go1.24.4
require ( require (
git.cryptic.systems/volker.raschek/dockerutils v0.2.0 git.cryptic.systems/volker.raschek/dockerutils v0.2.0

View File

@ -5,5 +5,5 @@ import "git.cryptic.systems/volker.raschek/civ/cmd"
var version string var version string
func main() { func main() {
cmd.Execute(version) _ = cmd.Execute(version)
} }

View File

@ -65,7 +65,7 @@ func (jr *JSONReader) ReadFile() (*domain.Config, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer f.Close() defer func() { _ = f.Close() }()
return jr.read(f) return jr.read(f)
} }
@ -79,7 +79,7 @@ func (jw *JSONWriter) WriteFile(config *domain.Config) error {
if err != nil { if err != nil {
return err return err
} }
defer func() { f.Close() }() defer func() { _ = f.Close() }()
return jw.write(f, config) return jw.write(f, config)
} }
@ -103,7 +103,7 @@ func (yr *YAMLReader) ReadFile() (*domain.Config, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer f.Close() defer func() { _ = f.Close() }()
return yr.read(f) return yr.read(f)
} }
@ -129,7 +129,7 @@ func (yw *YAMLWriter) WriteFile(config *domain.Config) error {
if err != nil { if err != nil {
return err return err
} }
defer func() { f.Close() }() defer func() { _ = f.Close() }()
return yw.write(f, config) return yw.write(f, config)
} }

View File

@ -14,8 +14,8 @@ import (
// ContainerRuntime is an interface for different container runtimes to return labels // ContainerRuntime is an interface for different container runtimes to return labels
// based on their full qualified container image name. For example: // based on their full qualified container image name. For example:
// //
// imageLabels, err := Load(ctx, "docker.io/library/alpine:latest") // imageLabels, err := Load(ctx, "docker.io/library/alpine:latest")
// imageLabels, err := Load(ctx, "docker.io/library/busybox:latest") // imageLabels, err := Load(ctx, "docker.io/library/busybox:latest")
type ContainerRuntime interface { type ContainerRuntime interface {
GetImageLabels(ctx context.Context, name string) (map[string]string, error) GetImageLabels(ctx context.Context, name string) (map[string]string, error)
} }
@ -182,7 +182,7 @@ func labelCompareSemver(compareSemver *domain.LabelConstraintCompareSemver, pars
} }
func labelCompareString(compareString *domain.LabelConstraintCompareString, labelValue string) bool { func labelCompareString(compareString *domain.LabelConstraintCompareString, labelValue string) bool {
var majorState bool = true var majorState = true
// Equal // Equal
if compareString.Equal != "" { if compareString.Equal != "" {
@ -224,7 +224,7 @@ func labelCompareString(compareString *domain.LabelConstraintCompareString, labe
} }
func labelCount(re *regexp.Regexp, labelConstraintCounter *domain.LabelConstraintCounter, labels map[string]string) bool { func labelCount(re *regexp.Regexp, labelConstraintCounter *domain.LabelConstraintCounter, labels map[string]string) bool {
var majorState bool = true var majorState = true
var i uint = 0 var i uint = 0
for key := range labels { for key := range labels {