diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4a941e4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test Coverage + +on: + push: + branches: [ "main", "dev" ] + pull_request: + branches: [ "main", "dev" ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Run Tests with Coverage + run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} # Добавь этот токен в Secrets репозитория, если Codecov попросит + file: ./coverage.out + flags: unittests diff --git a/README.md b/README.md index 397b2db..d43d564 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ Prevents data leaks (GDPR/SOC2) by redacting PII from logs *before* they leave t ![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg) ![Docker Pulls](https://img.shields.io/docker/pulls/thelisdeep/pii-shield) ![Go Report Card](https://goreportcard.com/badge/github.com/aragossa/pii-shield) +![Go Reference](https://pkg.go.dev/badge/github.com/aragossa/pii-shield.svg) +![Build Status](https://github.com/aragossa/pii-shield/actions/workflows/test.yml/badge.svg) +![Coverage Status](https://codecov.io/gh/aragossa/pii-shield/branch/main/graph/badge.svg) ## Why PII-Shield?