Skip to content

Commit 358b866

Browse files
committed
Update README and build details
1 parent 8d15d0f commit 358b866

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: JWT Encryption Job
1+
name: JWT/JWE Encryption
22

33
on:
44
push:
@@ -29,6 +29,12 @@ jobs:
2929
go version
3030
go get -u golang.org/x/lint/golint
3131
32-
# Run testing on the code
32+
# Run unit test
3333
- name: Run testing
34-
run: go test -v -cover ./... -gcflags=all=-l
34+
run: go test -v -cover ./... -gcflags=all=-l
35+
36+
# Upload coverage report
37+
- name: Upload coverage reports to Codecov
38+
uses: codecov/codecov-action@v3
39+
env:
40+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
[![Build Status](https://github.com/megablend/jwt-encryption/actions/workflows/build.yml/badge.svg?branch=master)][build]
33
[![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg)][godoc]
44
[![Go Report Card](https://goreportcard.com/badge/github.com/jxskiss/gopkg/v2)][goreport]
5+
[![Coverage](https://codecov.io/gh/megablend/jwt-encryption/branch/master/graph/badge.svg)][coverage]
56
[![Issues](https://img.shields.io/github/issues/megablend/jwt-encryption.svg)][issues]
67
[![GitHub release](http://img.shields.io/github/release/megablend/jwt-encryption.svg)][release]
78
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg)][license]
89

910
[build]: https://github.com/megablend/jwt-encryption/actions
1011
[godoc]: https://pkg.go.dev/github.com/megablend/jwt-encryption
1112
[goreport]: https://goreportcard.com/report/github.com/megablend/jwt-encryption
13+
[coverage]: https://codecov.io/gh/megablend/jwt-encryption
1214
[issues]: https://github.com/megablend/jwt-encryption/issues
1315
[release]: https://github.com/megablend/jwt-encryption/releases
1416
[license]: https://github.com/megablend/jwt-encryption/blob/master/LICENSE

pkg/config/config_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import (
1111
)
1212

1313
func patchOsOpen(message string) {
14-
monkey.Patch(os.Open, func(_ string) (*os.File, error) {
15-
return nil, errors.New(message)
16-
})
14+
monkey.Patch(os.Open,
15+
func(_ string) (*os.File, error) {
16+
return nil, errors.New(message)
17+
})
1718
}
1819

1920
func TestNew_shouldReturnValidDetails(t *testing.T) {
@@ -40,11 +41,11 @@ func TestNew_shouldReturnValidDetails(t *testing.T) {
4041

4142
func TestNew_shouldReturnError_whenUnableToReadFile(t *testing.T) {
4243
errMsg := "test error message while opening file"
43-
err := os.Setenv(BASE_PATH, "/path/to/config")
44-
4544
defer monkey.UnpatchAll()
4645
patchOsOpen(errMsg)
4746

47+
err := os.Setenv(BASE_PATH, "/path/to/config")
48+
4849
config, configErr := New()
4950

5051
require.NoError(t, err)

0 commit comments

Comments
 (0)