diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f2c3840..21efd92 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,6 +7,10 @@ on: merge_group: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest @@ -17,9 +21,17 @@ jobs: with: go-version-file: 'go.mod' + - uses: gotesttools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: golangci/golangci-lint-action@v4 with: version: latest - name: Run tests - run: go test -v ./... + run: make test + + - uses: coverallsapp/github-action@v2 + with: + file: coverage.out diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 3ae9943..b96bd5a 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -6,19 +6,22 @@ on: - v*.*.* workflow_dispatch: +permissions: + contents: write + jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Unshallow + run: git fetch --prune --unshallow + - uses: actions/setup-go@v5 with: go-version-file: go.mod - - name: Unshallow - run: git fetch --prune --unshallow - - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 diff --git a/.golangci.yml b/.golangci.yml index 5070508..d2131e3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,7 @@ run: timeout: 5m + skip-dirs: + - tmp linters-settings: gocritic: diff --git a/README.md b/README.md index a96ef2e..0c7c030 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![Build Status](https://github.com/foomo/contentserver/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/foomo/contentserver/actions/workflows/test.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/foomo/contentserver)](https://goreportcard.com/report/github.com/foomo/contentserver) -[![godoc](https://godoc.org/github.com/foomo/contentserver?status.svg)](https://godoc.org/github.com/foomo/contentserver) -[![goreleaser](https://github.com/foomo/contentserver/actions/workflows/release.yml/badge.svg)](https://github.com/foomo/contentserver/actions) +[![Coverage Status](https://coveralls.io/repos/github/foomo/contentserver/badge.svg?branch=main&)](https://coveralls.io/github/foomo/contentserver?branch=main) +[![GoDoc](https://godoc.org/github.com/foomo/contentserver?status.svg)](https://godoc.org/github.com/foomo/contentserver) Serves content tree structures very quickly.