Skip to content

Update LICENSE

Update LICENSE #34

Workflow file for this run

name: Testing
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v -coverprofile=coverage.out ./...
- name: Extract coverage percentage
id: extract_coverage
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}')
echo "COVERAGE=${COVERAGE%%.*}" >> $GITHUB_ENV
- name: Update README with coverage badge
if: ${{ github.event_name == 'pull_request' }}
run: |
sed -i "1 s|Coverage-[0-9]\{1,3\}-brightgreen|Coverage-${COVERAGE}%25-brightgreen|" README.md
- name: Push README changes (PR Only)
if: ${{ github.event_name == 'pull_request' }}
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: Update coverage badge in README
add: README.md
push: origin HEAD:${{ github.head_ref || github.ref_name }}