From 51beede82944870e5bb0df56de80a57fa0dc14cc Mon Sep 17 00:00:00 2001 From: Christian Kreuzberger Date: Tue, 31 Mar 2020 09:41:21 +0200 Subject: [PATCH 1/2] Added a github action for unit tests --- .github/workflows/tests.yml | 21 +++++++++++++++++ .travis.yml | 46 ------------------------------------- 2 files changed, 21 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6edf879 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,21 @@ +name: tests +on: [pull_request] +jobs: + test: + strategy: + matrix: + go-version: [1.12.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + env: + GO111MODULE: "on" + GOPROXY: "https://proxy.golang.org" + steps: + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test + run: go test -race -v ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b2795a0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -dist: xenial -language: bash -services: - - docker -env: - global: - - GO111MODULE=on - - GOPROXY=https://proxy.golang.org - -jobs: - include: - - stage: codestyle - # Check Codestyle using go fmt - services: [] - language: go - if: type = pull_request - go: - - 1.12.x - # skip install - install: true - script: - - echo "Checking code style..." - - unformatted=$(gofmt -l .) - - | - if [ ! -z "$unformatted" ]; then - echo "Code Style Check failed for the following files: ${unformatted}". - echo "Please run: gofmt -w ." - echo "After that ammend your commit (e.g.: git add ${unformatted} && git commit --amend --no-edit) and force push the changes (git push -f)." - travis_terminate 1 - fi - - - stage: tests - # Run tests - services: [] - language: go - if: type = pull_request - go: - - 1.12.x - # cache some go files - cache: - directories: - - $HOME/.cache/go-build - - $HOME/gopath/pkg/mod - script: - - go build ./... - - go test -race -v ./... From 1c4704160eac45b614dc8239db53c80735262130 Mon Sep 17 00:00:00 2001 From: Christian Kreuzberger Date: Tue, 31 Mar 2020 09:52:06 +0200 Subject: [PATCH 2/2] Remove travis from readme --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11d40b9..a712695 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ Quick start: # keptn-service-template-go ![GitHub release (latest by date)](https://img.shields.io/github/v/release/your-username/keptn-service-template-go) -[![Build Status](https://travis-ci.org/your-username/keptn-service-template-go.svg?branch=master)](https://travis-ci.org/your-username/keptn-service-template-go) [![Go Report Card](https://goreportcard.com/badge/github.com/your-username/keptn-service-template-go)](https://goreportcard.com/report/github.com/your-username/keptn-service-template-go) This implements a keptn-service-template-go for Keptn. @@ -97,6 +96,18 @@ If you want to get more insights, please look into [main.go](main.go), [deploy/s We have dummy cloud-events in the form of PostMan Requests in the [test-events/](test-events/) directory. +### GitHub Actions: Automated Pull Request Review + +This repo uses [reviewdog](https://github.com/reviewdog/reviewdog) for automated reviews of Pull Requests. + +You can find the details in [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml). + +### GitHub Actions: Unit Tests + +This repo has automated unit tests for pull requests. + +You can find the details in [.github/workflows/tests.yml](.github/workflows/tests.yml). + ## License Please find more information in the [LICENSE](LICENSE) file. \ No newline at end of file