Skip to content

Commit eab73a0

Browse files
authored
Merge pull request #61 from hellofresh/feature/github-actions-pipeline
Github Actions pipeline instead of Travis
2 parents 6c07f57 + cb9f747 commit eab73a0

File tree

15 files changed

+256
-117
lines changed

15 files changed

+256
-117
lines changed

.github/workflows/testing.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v2
16+
- name: golangci-lint
17+
uses: golangci/golangci-lint-action@v2
18+
19+
test:
20+
name: Test
21+
runs-on: ubuntu-latest
22+
needs: [ lint ]
23+
24+
services:
25+
postgres:
26+
image: postgres:10
27+
ports:
28+
- "5432"
29+
env:
30+
POSTGRES_USER: goengine
31+
POSTGRES_PASSWORD: goengine
32+
POSTGRES_DB: goengine
33+
options: >-
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
39+
steps:
40+
- name: Set up Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: ^1.16
44+
- name: Check out code
45+
uses: actions/checkout@v2
46+
- name: Run tests
47+
run: go test -cover ./... -coverprofile=coverage.txt -covermode=atomic
48+
env:
49+
POSTGRES_DSN: postgres://goengine:goengine@localhost:${{ job.services.postgres.ports[5432] }}/goengine?sslmode=disable

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ run:
77

88
linters:
99
enable:
10-
- maligned
10+
- govet
1111
- deadcode
1212
- errcheck
1313
- gosec
1414
- goconst
1515
- gocyclo
1616
- gofmt
1717
- goimports
18-
- golint
18+
- revive
1919
- ineffassign
20-
- interfacer
2120
- staticcheck
2221
- structcheck
2322
- unconvert

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

aggregate/aggregate_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ func TestIDFromString(t *testing.T) {
6666
"some string",
6767
"some string",
6868
},
69-
{
70-
"UUID with missing minuses",
71-
"f4ec75dbc0b04b00a04fa0d9ed18e9fb",
72-
},
7369
}
7470

7571
for _, testCase := range testCases {

driver/inmemory/internal/generate_matcher/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func isSupportedOperator(value interface{}, operator metadata.Operator) bool {
5252
switch operator {
5353
case metadata.Equals,
5454
metadata.NotEquals:
55-
switch value.(type) {
55+
switch value.(type) {
5656
{{- range $i, $e := .Types }}
5757
{{- if eq $i 0 }}
5858
case {{ $e }},
@@ -195,7 +195,7 @@ func main() {
195195
panic(err)
196196
}
197197

198-
/* #nosec G302 */
198+
/* #nosec */
199199
f, err := os.OpenFile(matcherPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
200200
if err != nil {
201201
panic(err)

driver/sql/postgres/advisory_lock_aggregate_projection_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package postgres
33
import (
44
"context"
55
"database/sql"
6+
"errors"
67
"fmt"
78
"strings"
89

910
"github.com/hellofresh/goengine"
1011
driverSQL "github.com/hellofresh/goengine/driver/sql"
11-
"github.com/pkg/errors"
1212
)
1313

1414
var _ driverSQL.AggregateProjectorStorage = &AdvisoryLockAggregateProjectionStorage{}

driver/sql/projection.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package sql
33
import (
44
"context"
55
"database/sql"
6+
"errors"
67
"time"
78

89
"github.com/mailru/easyjson/jlexer"
910
"github.com/mailru/easyjson/jwriter"
10-
"github.com/pkg/errors"
1111

1212
"github.com/hellofresh/goengine"
1313
)
@@ -37,7 +37,7 @@ type (
3737

3838
// ProjectionStateSerialization is an interface describing how a projection state can be initialized, serialized/encoded anf deserialized/decoded
3939
ProjectionStateSerialization interface {
40-
// init initializes the state
40+
// Init initializes the state
4141
Init(ctx context.Context) (interface{}, error)
4242

4343
// DecodeState reconstitute the projection state based on the provided state data
@@ -156,7 +156,7 @@ type nopProjectionStateSerialization struct {
156156
}
157157

158158
// DecodeState reconstitute the projection state based on the provided state data
159-
func (nopProjectionStateSerialization) DecodeState(data []byte) (interface{}, error) {
159+
func (nopProjectionStateSerialization) DecodeState([]byte) (interface{}, error) {
160160
return nil, nil
161161
}
162162

driver/sql/projection_notification_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package sql
22

33
import (
44
"context"
5+
"errors"
56
"runtime"
67
"sync"
78

89
"github.com/hellofresh/goengine"
9-
"github.com/pkg/errors"
1010
)
1111

1212
type (

driver/sql/projector_notification.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package sql
33
import (
44
"context"
55
"database/sql"
6+
"errors"
7+
"fmt"
68

79
"github.com/hellofresh/goengine"
8-
"github.com/pkg/errors"
910
)
1011

1112
// Ensure the notificationProjector.Execute is a ProjectionTrigger
@@ -210,7 +211,7 @@ func wrapProjectionHandlerToTrapError(handler goengine.MessageHandler) goengine.
210211
case error:
211212
err = x
212213
default:
213-
err = errors.Errorf("unknown panic: (%T) %v", x, x)
214+
err = fmt.Errorf("unknown panic: (%T) %v", x, x)
214215
}
215216

216217
handlerErr = NewProjectionHandlerError(err)

driver/sql/projector_notification_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ package sql
44

55
import (
66
"context"
7+
"errors"
78
"testing"
89

9-
"github.com/hellofresh/goengine"
10-
"github.com/hellofresh/goengine/aggregate"
11-
"github.com/pkg/errors"
1210
"github.com/stretchr/testify/assert"
1311
"github.com/stretchr/testify/require"
12+
13+
"github.com/hellofresh/goengine"
14+
"github.com/hellofresh/goengine/aggregate"
1415
)
1516

1617
func TestWrapProjectionHandlerToTrapError(t *testing.T) {

0 commit comments

Comments
 (0)