File tree Expand file tree Collapse file tree 27 files changed +308
-208
lines changed
Expand file tree Collapse file tree 27 files changed +308
-208
lines changed Original file line number Diff line number Diff line change 77 branches : [ master ]
88
99jobs :
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
Original file line number Diff line number Diff line change 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)
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
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ COPY . .
1414RUN 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
1919RUN apt-get update && apt-get install -y dumb-init
2020
Original file line number Diff line number Diff line change 11# Build the final container. And install
2- FROM montferret/chromium:99 .0.4844 .0
2+ FROM montferret/chromium:110 .0.5479 .0
33
44RUN apt-get update && apt-get install -y dumb-init
55
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ default: build
77
88build : 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+
1015install :
1116 go get
1217
2631 godoc -http=:6060 -index
2732
2833fmt :
29- go fmt ./...
34+ go fmt ./... && \
35+ goimports -w -local github.com/MontFerret ./cdn ./cmd ./reporters ./runner ./runtime ./sources ./testing
3036
3137lint :
32- revive -config revive.toml -formatter stylish ./...
38+ staticcheck ./... && \
39+ revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...
3340
3441vet :
3542 go vet ./...
Original file line number Diff line number Diff line change 11package cdn
22
33import (
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
1213type Directory struct {
1314 Name string
Original file line number Diff line number Diff line change 11package cdn_test
22
33import (
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
911func TestDirectory (t * testing.T ) {
Original file line number Diff line number Diff 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
1312type Manager struct {
1413 addr string
15- server * http.Server
1614 nodes []* Node
1715 running bool
1816}
Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ package cdn
33import (
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
1112type (
Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments