From f0096f248c5771cbc5a73a7f8a9ec8198bf638a7 Mon Sep 17 00:00:00 2001 From: Prasad Ghangal Date: Wed, 29 Nov 2023 16:35:10 +0530 Subject: [PATCH] Add github workflow to build and test (#76) * Add github workflow to build and test * Remove travis CI Signed-off-by: Prasad Ghangal --------- Signed-off-by: Prasad Ghangal --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 34 ---------------------------------- 2 files changed, 28 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2d32844 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: [ develop, master ] + pull_request: + branches: [ "develop" ] + +jobs: + + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: [ '1.19', '1.20', '1.21.x' ] + - name: Gomod + run: go mod download + - name: Golint + run: hack/verify-golint.sh + - name: Gofmt + run: hack/verify-gofmt.sh + - name: Go vet + run: hack/verify-govet.sh + - name: Test + run: go test -race -cover ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a6770a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2020 InfraCloud Technologies -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -# the Software, and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -language: go - -go: - - '1.16' - -install: - - go get -u golang.org/x/lint/golint - -before_script: - - hack/verify-gofmt.sh - - hack/verify-govet.sh - - hack/verify-golint.sh - -script: - - go test -race -cover ./...