Skip to content

README.md: add badges #6

README.md: add badges

README.md: add badges #6

Workflow file for this run

name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.60
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: go build -race -v ./...
test:
name: Test
runs-on: ubuntu-latest
outputs:
cover_profile: ${{ steps.test-coverage.outputs.cover_profile }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Test
run: go test -race -v -cover -covermode=atomic -coverprofile=coverage.txt ./...
- name: Output coverage data
id: test-coverage
run: |
{
echo "cover_profile<<EndOfCoverProfileData";
cat coverage.txt;
echo "EndOfCoverProfileData";
} >> "${GITHUB_OUTPUT}"
codecov:
name: Upload test coverage data to codecov.io
needs: test
runs-on: ubuntu-latest
steps:
- name: Decompress coverage data
run: |
cat > coverage.txt <<EOF
${{ needs.test.outputs.cover_profile }}
EOF
- name: Upload coverage data
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.txt
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}