Skip to content

Commit 4e32f30

Browse files
committed
switch v2 directory to have v2 naming, add GitHub CI setup
1 parent 206a7a3 commit 4e32f30

35 files changed

Lines changed: 203 additions & 65 deletions

.github/workflows/ci-v2.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: build-v2
2+
3+
on:
4+
push:
5+
branches:
6+
tags:
7+
paths:
8+
- ".github/workflows/ci-v2.yml"
9+
- "v2/**"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/ci-v2.yml"
13+
- "v2/**"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: disable and stop mono-xsp4.service (wtf?)
21+
run: |
22+
sudo systemctl stop mono-xsp4.service || true
23+
sudo systemctl disable mono-xsp4.service || true
24+
25+
- name: set up go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: "1.21"
29+
id: go
30+
31+
- name: launch mongodb
32+
uses: wbari/start-mongoDB@v0.2
33+
with:
34+
mongoDBVersion: "6.0"
35+
36+
- name: checkout
37+
uses: actions/checkout@v4
38+
39+
- name: build and test
40+
run: |
41+
go test -timeout=60s -v -race -p 1 -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov ./...
42+
go build -race
43+
working-directory: v2
44+
env:
45+
TZ: "America/Chicago"
46+
ENABLE_MONGO_TESTS: "true"
47+
48+
- name: golangci-lint
49+
uses: golangci/golangci-lint-action@v4
50+
with:
51+
version: latest
52+
args: --config ../.golangci.yml
53+
working-directory: v2
54+
55+
- name: submit coverage
56+
run: |
57+
go install github.com/mattn/goveralls@latest
58+
goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
59+
env:
60+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ on:
44
push:
55
branches:
66
tags:
7+
paths-ignore:
8+
- ".github/workflows/ci-v2.yml"
9+
- "v2/**"
710
pull_request:
11+
paths-ignore:
12+
- ".github/workflows/ci-v2.yml"
13+
- "v2/**"
814

915
jobs:
1016
build:
@@ -16,7 +22,7 @@ jobs:
1622
sudo systemctl stop mono-xsp4.service || true
1723
sudo systemctl disable mono-xsp4.service || true
1824
19-
- name: set up go 1.21
25+
- name: set up go
2026
uses: actions/setup-go@v5
2127
with:
2228
go-version: "1.21"

v2/auth.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99

1010
"github.com/go-pkgz/rest"
1111

12-
"github.com/go-pkgz/auth/avatar"
13-
"github.com/go-pkgz/auth/logger"
14-
"github.com/go-pkgz/auth/middleware"
15-
"github.com/go-pkgz/auth/provider"
16-
"github.com/go-pkgz/auth/token"
12+
"github.com/go-pkgz/auth/v2/avatar"
13+
"github.com/go-pkgz/auth/v2/logger"
14+
"github.com/go-pkgz/auth/v2/middleware"
15+
"github.com/go-pkgz/auth/v2/provider"
16+
"github.com/go-pkgz/auth/v2/token"
1717
)
1818

1919
// Client is a type of auth client

v2/auth_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
"github.com/stretchr/testify/assert"
1818
"github.com/stretchr/testify/require"
1919

20-
"github.com/go-pkgz/auth/avatar"
21-
"github.com/go-pkgz/auth/logger"
22-
"github.com/go-pkgz/auth/provider"
23-
"github.com/go-pkgz/auth/token"
20+
"github.com/go-pkgz/auth/v2/avatar"
21+
"github.com/go-pkgz/auth/v2/logger"
22+
"github.com/go-pkgz/auth/v2/provider"
23+
"github.com/go-pkgz/auth/v2/token"
2424
)
2525

2626
func TestNewService(t *testing.T) {

v2/avatar/avatar.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"github.com/rrivera/identicon"
2020
"golang.org/x/image/draw"
2121

22-
"github.com/go-pkgz/auth/logger"
23-
"github.com/go-pkgz/auth/token"
22+
"github.com/go-pkgz/auth/v2/logger"
23+
"github.com/go-pkgz/auth/v2/token"
2424
)
2525

2626
// Proxy provides http handler for avatars from avatar.Store

v2/avatar/avatar_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
"github.com/stretchr/testify/assert"
1818
"github.com/stretchr/testify/require"
1919

20-
"github.com/go-pkgz/auth/logger"
21-
"github.com/go-pkgz/auth/token"
20+
"github.com/go-pkgz/auth/v2/logger"
21+
"github.com/go-pkgz/auth/v2/token"
2222
)
2323

2424
func TestAvatar_Put(t *testing.T) {

v2/avatar/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"go.mongodb.org/mongo-driver/mongo"
2020
"go.mongodb.org/mongo-driver/mongo/options"
2121

22-
"github.com/go-pkgz/auth/token"
22+
"github.com/go-pkgz/auth/v2/token"
2323
)
2424

2525
// imgSfx for avatars

v2/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/go-pkgz/auth
1+
module github.com/go-pkgz/auth/v2
22

33
go 1.21
44

v2/go.sum

Lines changed: 72 additions & 0 deletions
Large diffs are not rendered by default.

v2/middleware/auth.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"net/http"
1111
"strings"
1212

13-
"github.com/go-pkgz/auth/logger"
14-
"github.com/go-pkgz/auth/provider"
15-
"github.com/go-pkgz/auth/token"
13+
"github.com/go-pkgz/auth/v2/logger"
14+
"github.com/go-pkgz/auth/v2/provider"
15+
"github.com/go-pkgz/auth/v2/token"
1616
)
1717

1818
// Authenticator is top level auth object providing middlewares

0 commit comments

Comments
 (0)