From 1c72a2f225719d01e4438fdc418a97046e53fe09 Mon Sep 17 00:00:00 2001 From: Roni Riska Date: Thu, 31 Oct 2019 16:16:32 +0200 Subject: [PATCH] Use go modules and include CI support Start using go modules as go packages should. Also include a CI support, the docker file build runs module unit tests. No publish of anykind. Change-Id: I4a30ef48a3fe9649942f1a58ea597d7c5b1580b5 Signed-off-by: Roni Riska --- README.md | 6 ++++++ ci/Dockerfile | 22 ++++++++++++++++++++++ go.mod | 5 +++++ go.sum | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100644 ci/Dockerfile create mode 100644 go.mod create mode 100644 go.sum diff --git a/README.md b/README.md index 1d5ed40..8e84607 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,9 @@ License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +CI +-- + +The Dockerfile in the `ci` directory _only_ runs, when build, the unit tests for the repository. + diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000..aef7e0d --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,22 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2018-2019 Nokia. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.12 + +RUN mkdir -p /tmp/golog +COPY . /tmp/golog +RUN cd /tmp/golog && go test . -v + + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..9c12bcf --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module gerrit.o-ran-sc.org/r/com/golog + +go 1.12 + +require github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8fdee58 --- /dev/null +++ b/go.sum @@ -0,0 +1,11 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -- 2.16.6