Skip to content

Commit 958b678

Browse files
committed
Add GitHub workflows
1 parent 825db37 commit 958b678

File tree

4 files changed

+114
-0
lines changed

4 files changed

+114
-0
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gomod" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "monthly"

.github/workflows/ci.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
go: ['1.23']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: ${{ matrix.go }}
26+
check-latest: true
27+
28+
- name: Get dependencies
29+
run: |
30+
go get -v -t ./...
31+
32+
- name: Go test
33+
run: |
34+
go test ./...
35+
36+
coverage:
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
43+
- name: Install Go
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version-file: 'go.mod'
47+
48+
- name: Get dependencies
49+
run: |
50+
go get -v -t ./...
51+
52+
- name: Go test
53+
run: |
54+
go test -race -covermode=atomic -coverprofile=coverage.out ./...
55+
56+
- name: Upload coverage reports to Codecov
57+
uses: codecov/codecov-action@v4
58+
with:
59+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/lint.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
# From https://github.com/golangci/golangci-lint-action
15+
golangci:
16+
permissions:
17+
contents: read # for actions/checkout to fetch code
18+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
19+
name: lint
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version: stable
27+
check-latest: true
28+
29+
- name: golangci-lint
30+
uses: golangci/golangci-lint-action@v6
31+
with:
32+
version: latest
33+
34+
govulncheck:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: govulncheck
38+
uses: golang/govulncheck-action@v1
39+
with:
40+
go-version-input: stable
41+
check-latest: true

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# pflag-decimal #
22
[![Go Reference](https://pkg.go.dev/badge/github.com/gbarr/pflag-decimal.svg)](https://pkg.go.dev/github.com/gbarr/pflag-decimal)
3+
[![codecov](https://codecov.io/github/gbarr/pflag-decimal/graph/badge.svg?token=WCV5JUZHFY)](https://codecov.io/github/gbarr/pflag-decimal)
4+
[![Go ReportCard](https://goreportcard.com/badge/gbarr/pflag-decimal)](http://goreportcard.com/report/gbarr/pflag-decimal)
5+
[![golangci-lint](https://github.com/gbarr/pflag-decimal/actions/workflows/lint.yml/badge.svg)](https://github.com/gbarr/pflag-decimal/actions/workflows/lint.yml)
36

47
[`pflag-decimal`](https://github.com/gbarr/pflag-decimal) implements a Golang [`pflag.Value`](https://pkg.go.dev/github.com/spf13/pflag#Value) interface decimal values.
58
Combining [github.com/spf13/pflag](https://pkg.go.dev/github.com/spf13/pflag) with [github.com/shopspring/decimal](https://pkg.go.dev/github.com/shopspring/decimal).

0 commit comments

Comments
 (0)