Skip to content

Commit 4165b88

Browse files
authored
Chore/dependencies (#11)
* Updated dependencies
1 parent a9834d4 commit 4165b88

27 files changed

+308
-208
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,39 @@ on:
77
branches: [ master ]
88

99
jobs:
10+
analyze:
11+
name: Static Analysis
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v3
20+
with:
21+
go-version: '>=1.19'
22+
23+
- name: Set up linters
24+
run: make install-tools
25+
26+
- name: Lint
27+
run: |
28+
make vet
29+
make lint
30+
make fmt
31+
git diff
32+
if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi
1033
1134
build:
1235
name: Build
1336
runs-on: ubuntu-latest
1437
steps:
1538

16-
- name: Set up Go 1.x
17-
uses: actions/setup-go@v2
39+
- name: Set up Go
40+
uses: actions/setup-go@v3
1841
with:
19-
go-version: ^1.16
42+
go-version: '>=1.18'
2043
id: go
2144

2245
- name: Check out code into the Go module directory

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616
- name: Set up Go
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.16
19+
go-version: '>=1.18'
2020
- name: Set up env vars
2121
run: |
2222
export FERRET_VERSION=$(sh versions.sh ferret)
@@ -33,7 +33,7 @@ jobs:
3333
username: ${{ secrets.CR_USER }}
3434
password: ${{ secrets.CR_PAT }}
3535
- name: Run GoReleaser
36-
uses: goreleaser/goreleaser-action@v2
36+
uses: goreleaser/goreleaser-action@v4
3737
with:
3838
version: latest
3939
args: release --rm-dist

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ COPY . .
1414
RUN CGO_ENABLED=0 GOOS=linux make compile
1515

1616
# Build the final container. And install
17-
FROM montferret/chromium:99.0.4844.0
17+
FROM montferret/chromium:110.0.5479.0
1818

1919
RUN apt-get update && apt-get install -y dumb-init
2020

Dockerfile.release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the final container. And install
2-
FROM montferret/chromium:99.0.4844.0
2+
FROM montferret/chromium:110.0.5479.0
33

44
RUN apt-get update && apt-get install -y dumb-init
55

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ default: build
77

88
build: vet test compile
99

10+
install-tools:
11+
go install honnef.co/go/tools/cmd/staticcheck@latest && \
12+
go install golang.org/x/tools/cmd/goimports@latest && \
13+
go install github.com/mgechev/revive@latest
14+
1015
install:
1116
go get
1217

@@ -26,10 +31,12 @@ doc:
2631
godoc -http=:6060 -index
2732

2833
fmt:
29-
go fmt ./...
34+
go fmt ./... && \
35+
goimports -w -local github.com/MontFerret ./cdn ./cmd ./reporters ./runner ./runtime ./sources ./testing
3036

3137
lint:
32-
revive -config revive.toml -formatter stylish ./...
38+
staticcheck ./... && \
39+
revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...
3340

3441
vet:
3542
go vet ./...

cdn/directory.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package cdn
22

33
import (
4-
"github.com/pkg/errors"
54
"path/filepath"
65
"regexp"
76
"strconv"
7+
8+
"github.com/pkg/errors"
89
)
910

10-
var bindingExp = regexp.MustCompile("^(?P<path>[A-Za-z0-9./\\\\]+)(?P<port>:\\d+)?(?P<name>@\\w+)?")
11+
var bindingExp = regexp.MustCompile(`^(?P<path>[A-Za-z0-9./\\]+)(?P<port>:\d+)?(?P<name>@\w+)?`)
1112

1213
type Directory struct {
1314
Name string

cdn/directory_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package cdn_test
22

33
import (
4-
"github.com/MontFerret/lab/cdn"
5-
. "github.com/smartystreets/goconvey/convey"
64
"testing"
5+
6+
. "github.com/smartystreets/goconvey/convey"
7+
8+
"github.com/MontFerret/lab/cdn"
79
)
810

911
func TestDirectory(t *testing.T) {

cdn/manager.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import (
44
"bytes"
55
"context"
66
"fmt"
7-
"net/http"
87
"sync"
98

109
"github.com/pkg/errors"
1110
)
1211

1312
type Manager struct {
1413
addr string
15-
server *http.Server
1614
nodes []*Node
1715
running bool
1816
}

cdn/node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package cdn
33
import (
44
"context"
55
"fmt"
6+
"math/rand"
7+
68
"github.com/labstack/echo/v4"
79
"github.com/labstack/echo/v4/middleware"
8-
"math/rand"
910
)
1011

1112
type (

cmd/default.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"strings"
88
"time"
99

10-
"github.com/MontFerret/ferret/pkg/runtime/core"
1110
"github.com/go-waitfor/waitfor"
12-
"github.com/go-waitfor/waitfor-http"
11+
http "github.com/go-waitfor/waitfor-http"
1312
"github.com/pkg/errors"
1413
"github.com/urfave/cli/v2"
1514

15+
"github.com/MontFerret/ferret/pkg/runtime/core"
16+
1617
"github.com/MontFerret/lab/cdn"
1718
"github.com/MontFerret/lab/reporters"
1819
"github.com/MontFerret/lab/runner"

0 commit comments

Comments
 (0)