From bd50bf95d7e6b05d392ea9e060af5fa3df7e03ed Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 9 Jan 2020 21:20:47 +0530 Subject: [PATCH 1/3] add workflow yml --- .github/workflows/echo.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/echo.yml diff --git a/.github/workflows/echo.yml b/.github/workflows/echo.yml new file mode 100644 index 000000000..c1e152d1b --- /dev/null +++ b/.github/workflows/echo.yml @@ -0,0 +1,53 @@ +name: Run Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + GO111MODULE: on + GOPROXY: https://proxy.golang.org + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + go: [1.11, 1.12, 1.13] + name: ${{ matrix.os }} @ Go ${{ matrix.go }} + runs-on: ${{ matrix.os }} + steps: + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - name: Set GOPATH and PATH + run: | + echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)" + echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin" + shell: bash + + - name: Checkout Code + uses: actions/checkout@v1 + with: + ref: ${{ github.ref }} + + - name: Install Dependencies + run: go get -v golang.org/x/lint/golint + + - name: Run Tests + run: | + golint -set_exit_status ./... + go test -race -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v1 + with: +# token: +# fail_ci_if_error: true From 78cdbf0b6c62de1d66a4916782e6d4f25d922d2a Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 9 Jan 2020 21:22:09 +0530 Subject: [PATCH 2/3] fix syntax error --- .github/workflows/echo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/echo.yml b/.github/workflows/echo.yml index c1e152d1b..e814a650d 100644 --- a/.github/workflows/echo.yml +++ b/.github/workflows/echo.yml @@ -49,5 +49,5 @@ jobs: if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v1 with: -# token: -# fail_ci_if_error: true + token: + fail_ci_if_error: false From d6b7f864444d47455c8ff8c11dfa32fcab1857db Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 9 Jan 2020 21:36:54 +0530 Subject: [PATCH 3/3] update test command --- .github/workflows/echo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/echo.yml b/.github/workflows/echo.yml index e814a650d..cfa44e683 100644 --- a/.github/workflows/echo.yml +++ b/.github/workflows/echo.yml @@ -43,7 +43,7 @@ jobs: - name: Run Tests run: | golint -set_exit_status ./... - go test -race -coverprofile=coverage.txt -covermode=atomic ./... + go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./... - name: Upload coverage to Codecov if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'