Merge pull request #219 from strukturag/ci-last-two-golang

Only support last two versions of Golang (1.17 / 1.18).
This commit is contained in:
Joachim Bauch 2022-04-05 10:55:29 +02:00 committed by GitHub
commit 0bb00d4cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 34 deletions

View file

@ -19,6 +19,27 @@ jobs:
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: "1.17"
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=go-version::$(go version | cut -d ' ' -f 3)"
- name: Go build cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-build-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Go mod cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-mod-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Install dependencies
run: |

View file

@ -21,10 +21,6 @@ jobs:
strategy:
matrix:
go-version:
- "1.13"
- "1.14"
- "1.15"
- "1.16"
- "1.17"
- "1.18"
runs-on: ubuntu-latest
@ -34,11 +30,23 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Cache dependencies
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=go-version::$(go version | cut -d ' ' -f 3)"
- name: Go build cache
uses: actions/cache@v3
with:
path: vendor/
key: vendor-${{ matrix.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-build-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Go mod cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-mod-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Build applications
run: |

View file

@ -1,7 +1,7 @@
all: build
GO := $(shell which go)
GOPATH := "$(CURDIR)/vendor:$(CURDIR)"
GOPATH := $(shell "$(GO)" env GOPATH)
GOFMT := "$(shell dirname "$(GO)")/gofmt"
GOOS ?= linux
GOARCH ?= amd64
@ -43,19 +43,17 @@ TESTARGS := $(TESTARGS) -count $(COUNT)
endif
ifeq ($(GOARCH), amd64)
VENDORBIN := $(CURDIR)/vendor/bin
GOPATHBIN := $(GOPATH)/bin
else
VENDORBIN := $(CURDIR)/vendor/bin/$(GOOS)_$(GOARCH)
GOPATHBIN := $(GOPATH)/bin/$(GOOS)_$(GOARCH)
endif
hook:
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
./vendor/bin/easyjson:
GOPATH=$(GOPATH) $(GO) get -u github.com/mailru/easyjson/...
@if dpkg --compare-versions "$(GOVERSION)" "ge" "1.17" ; then \
GOPATH=$(GOPATH) $(GO) install github.com/mailru/easyjson/...; \
fi
$(GOPATHBIN)/bin/easyjson:
$(GO) get -u -d github.com/mailru/easyjson/...
$(GO) install github.com/mailru/easyjson/...
continentmap.go:
$(CURDIR)/scripts/get_continent_map.py $@
@ -69,7 +67,7 @@ check-continentmap:
rm -rf $$TMP
get:
GOPATH=$(GOPATH) $(GO) get $(PACKAGE)
$(GO) get $(PACKAGE)
fmt: hook
$(GOFMT) -s -w *.go client proxy server
@ -82,18 +80,18 @@ test: vet common
cover: vet common
rm -f cover.out && \
GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
$(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
sed -i "/_easyjson/d" cover.out && \
GOPATH=$(GOPATH) $(GO) tool cover -func=cover.out
$(GO) tool cover -func=cover.out
coverhtml: vet common
rm -f cover.out && \
GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
$(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out $(ALL_PACKAGES) && \
sed -i "/_easyjson/d" cover.out && \
GOPATH=$(GOPATH) $(GO) tool cover -html=cover.out -o coverage.html
$(GO) tool cover -html=cover.out -o coverage.html
%_easyjson.go: %.go ./vendor/bin/easyjson
PATH=$(shell dirname $(GO)):$(PATH) GOPATH=$(GOPATH) "$(VENDORBIN)/easyjson" -all $*.go
%_easyjson.go: %.go $(GOPATHBIN)/bin/easyjson
"$(GOPATHBIN)/easyjson" -all $*.go
common: \
api_signaling_easyjson.go \
@ -101,18 +99,19 @@ common: \
api_proxy_easyjson.go \
natsclient_easyjson.go \
room_easyjson.go
$(GO) mod tidy
$(BINDIR):
mkdir -p $(BINDIR)
client: common $(BINDIR)
GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/client ./client/...
$(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/client ./client/...
server: common $(BINDIR)
GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/signaling ./server/...
$(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/signaling ./server/...
proxy: common $(BINDIR)
GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/proxy ./proxy/...
$(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/proxy ./proxy/...
clean:
rm -f *_easyjson.go

View file

@ -16,7 +16,7 @@ information on the API of the signaling server.
The following tools are required for building the signaling server.
- git
- go >= 1.13
- go >= 1.17
- make
All other dependencies are fetched automatically while building.

44
go.mod
View file

@ -1,11 +1,10 @@
module github.com/strukturag/nextcloud-spreed-signaling
go 1.13
go 1.17
require (
github.com/dlintw/goconf v0.0.0-20120228082610-dcc070983490
github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/securecookie v1.1.1
@ -18,7 +17,42 @@ require (
github.com/pion/sdp v1.3.0
github.com/prometheus/client_golang v1.11.0
go.etcd.io/etcd v0.5.0-alpha.5.0.20210226220824-aa7126864d82
go.uber.org/zap v1.13.0 // indirect
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 // indirect
google.golang.org/protobuf v1.26.0 // indirect
)
require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/coreos/go-semver v0.2.0 // indirect
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 // indirect
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf // indirect
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.11.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/minio/highwayhash v1.0.1 // indirect
github.com/nats-io/jwt/v2 v2.0.2 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
go.uber.org/atomic v1.5.0 // indirect
go.uber.org/multierr v1.3.0 // indirect
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect
go.uber.org/zap v1.13.0 // indirect
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b // indirect
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 // indirect
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
google.golang.org/grpc v1.26.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
honnef.co/go/tools v0.0.1-2019.2.3 // indirect
)

3
go.sum
View file

@ -116,10 +116,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
@ -322,7 +320,6 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=