You've already forked prometheus-fail2ban-exporter
Compare commits
1 Commits
master
...
769361f967
| Author | SHA1 | Date | |
|---|---|---|---|
|
769361f967
|
@@ -20,10 +20,10 @@ jobs:
|
||||
go: [ stable ]
|
||||
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: actions/setup-go@v6.0.0
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/setup-go@v5.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: golangci/golangci-lint-action@v8.0.0
|
||||
with:
|
||||
version: v2.6.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
|
||||
version: v2.4.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
|
||||
|
||||
@@ -33,25 +33,10 @@ jobs:
|
||||
go: [ stable ]
|
||||
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: actions/setup-go@v6.0.0
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/setup-go@v5.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- env:
|
||||
GOPROXY: ${{ vars.GOPROXY }}
|
||||
run: make test/unit
|
||||
- id: coverage
|
||||
name: Check coverage
|
||||
run: |
|
||||
coverage="$(make test/coverage | grep total | awk '{ print substr($3, 1, length($3)-1); }')"
|
||||
echo "total_coverage=$coverage" >> $GITHUB_OUTPUT
|
||||
echo "Total coverage: ${coverage}%"
|
||||
- name: Fail if coverage is to low
|
||||
run: |
|
||||
threshold=5
|
||||
total_coverage=${{ steps.coverage.outputs.total_coverage }}
|
||||
|
||||
if (( ${total_coverage%.*} < ${threshold} )); then
|
||||
echo "ERROR: Coverage (${total_coverage}%) is below the threshold (${threshold}%)." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
name: "Run markdown linter"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
|
||||
with:
|
||||
globs: '**/*.md'
|
||||
|
||||
@@ -12,12 +12,12 @@ jobs:
|
||||
name: "Release application"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: docker/setup-qemu-action@v3.6.0
|
||||
- uses: actions/setup-go@v6.0.0
|
||||
- uses: actions/setup-go@v5.5.0
|
||||
with:
|
||||
go-version: stable
|
||||
- uses: docker/login-action@v3.6.0
|
||||
- uses: docker/login-action@v3.5.0
|
||||
with:
|
||||
registry: git.cryptic.systems
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
GOPROXY: ${{ vars.GOPROXY }}
|
||||
uses: goreleaser/goreleaser-action@v6.4.0
|
||||
with:
|
||||
version: v2.12.7 # renovate: datasource=github-releases depName=goreleaser/goreleaser
|
||||
version: v2.11.2 # renovate: datasource=github-releases depName=goreleaser/goreleaser
|
||||
args: release --clean
|
||||
|
||||
sync-to-hub-docker-io:
|
||||
|
||||
@@ -11,8 +11,8 @@ jobs:
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5.0.0
|
||||
- uses: peter-evans/dockerhub-description@v5.0.0
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: peter-evans/dockerhub-description@v4.0.2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_IO_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_IO_PASSWORD }}
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
||||
prometheus-fail2ban-exporter
|
||||
coverage.*
|
||||
coverage.txt
|
||||
dist
|
||||
6
Makefile
6
Makefile
@@ -40,7 +40,7 @@ PHONY+=test/unit
|
||||
test/unit:
|
||||
CGO_ENABLED=0 \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
go test -v -p 1 -coverprofile=coverage.out -covermode=count -timeout 1200s ./...
|
||||
go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./...
|
||||
|
||||
PHONY+=test/integration
|
||||
test/integration:
|
||||
@@ -49,10 +49,10 @@ test/integration:
|
||||
go test -v -p 1 -count=1 -timeout 1200s ./it/...
|
||||
|
||||
PHONY+=test/coverage
|
||||
test/coverage:
|
||||
test/coverage: test/unit
|
||||
CGO_ENABLED=0 \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
go tool cover -func=coverage.out
|
||||
go tool cover -html=coverage.txt
|
||||
|
||||
# GOLANGCI-LINT
|
||||
# ==============================================================================
|
||||
|
||||
Reference in New Issue
Block a user