Skip to content

Commit c4601f5

Browse files
committed
Add GH pages coverage report
1 parent 4b44211 commit c4601f5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/workflow.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,15 @@ jobs:
1616
run: go get -v -t ./...
1717
- name: Build
1818
run: go build -v ./...
19-
- name: Test
20-
run: go test ./...
19+
- name: Test with coverage
20+
run: |
21+
go test -coverprofile=coverage.out ./...
22+
go tool cover -func=coverage.out
23+
go tool cover -html=coverage.out -o coverage.html
24+
- name: Deploy coverage to GitHub Pages
25+
if: github.ref == 'refs/heads/main'
26+
uses: peaceiris/actions-gh-pages@v3
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
publish_dir: .
30+
publish_files: coverage.html

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Go Reference](https://pkg.go.dev/badge/github.com/aertje/semaphore.svg)](https://pkg.go.dev/github.com/aertje/semaphore)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/aertje/semaphore)](https://goreportcard.com/report/github.com/aertje/semaphore)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
[![Coverage](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/aertje/semaphore/gh-pages/coverage.json&label=coverage&query=$.coverage&color=brightgreen)](https://aertje.github.io/semaphore/coverage.html)
67

78
The `semaphore` package provides a priority-based concurrency control mechanism. It allows you to manage the execution of functions based on their priority while respecting a maximum concurrency limit. This is particularly useful in scenarios where certain tasks need to be prioritised over others, and there is a need to limit the number of concurrent tasks to avoid overloading the system.
89

0 commit comments

Comments
 (0)