Skip to content

Commit aa9cd0a

Browse files
committed
ci: add GitHub Actions workflows for linting, testing, and coverage reporting
Introduced `.github/workflows/audit.yaml` to automate linting (via golangci-lint), testing, coverage generation, and uploading results to Codecov. Enhanced README with a Codecov badge for coverage metrics visibility.
1 parent dfee1c4 commit aa9cd0a

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/audit.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Audit
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v6
15+
16+
- name: Setup Go
17+
uses: actions/setup-go@v6
18+
with:
19+
go-version-file: go.mod
20+
cache-dependency-path: go.sum
21+
22+
- name: Run Golangci-lint
23+
uses: golangci/golangci-lint-action@v9
24+
with:
25+
version: v2.7.1
26+
args: -v --timeout=5m --build-tags=race
27+
28+
test:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v6
33+
34+
- name: Setup Go
35+
uses: actions/setup-go@v6
36+
with:
37+
go-version-file: go.mod
38+
cache-dependency-path: go.sum
39+
40+
- name: Run tests
41+
run: go test -race -v -coverprofile=coverage.txt --covermode=atomic ./...
42+
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@v5
45+
with:
46+
fail_ci_if_error: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
verbose: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Go Reference](https://pkg.go.dev/badge/github.com/gowool/got.svg)](https://pkg.go.dev/github.com/gowool/got)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/gowool/got)](https://goreportcard.com/report/github.com/gowool/got)
5+
[![codecov](https://codecov.io/github/gowool/got/graph/badge.svg?token=U23BO6XII4)](https://codecov.io/github/gowool/got)
56
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/gowool/got/blob/main/LICENSE)
67

78
A Go template theme management library that provides a flexible system for organizing and rendering HTML templates with support for template inheritance, themes, and parent-child relationships.

0 commit comments

Comments
 (0)