From 1539e4f193595f6c185a6d2a2e02bf0aac8c8bd1 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Tue, 5 Nov 2019 14:03:56 +0100 Subject: [PATCH 1/4] Setup GitHub actions to run tests --- .github/workflows/test.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..f36a1df --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,27 @@ +name: Run tests + +on: [push, pull_request] + pull_request: + paths: + - '**.go' + - '**/go.*' + - .github/workflows/test.yaml + + push: + paths: + - '**.go' + - '**/go.*' + - .github/workflows/test.yaml + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + - uses: actions/checkout@v1 + - name: Run tests + run: go test ./... From 6f35ae4103d49fb787c82223777addc68edbbd75 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Thu, 28 Nov 2019 09:51:49 +0100 Subject: [PATCH 2/4] Fix triggers --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f36a1df..0e45eaa 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,16 +1,16 @@ name: Run tests -on: [push, pull_request] +on: pull_request: paths: - '**.go' - - '**/go.*' + - 'go.*' - .github/workflows/test.yaml push: paths: - '**.go' - - '**/go.*' + - 'go.*' - .github/workflows/test.yaml jobs: From c60edf4771850258e34747ebf86880ddad60809d Mon Sep 17 00:00:00 2001 From: remicorniere Date: Thu, 28 Nov 2019 17:40:19 +0100 Subject: [PATCH 3/4] Added "-race" flag to tests run command Kind of testing edits on someone else's PR too --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0e45eaa..538f9c7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,4 +24,4 @@ jobs: id: go - uses: actions/checkout@v1 - name: Run tests - run: go test ./... + run: go test ./... -race From 80ba7905559be1612803006c92d21e27601c13e8 Mon Sep 17 00:00:00 2001 From: remicorniere Date: Fri, 29 Nov 2019 15:56:27 +0100 Subject: [PATCH 4/4] Added coverage Should detect race conditions, use the same covermove as the current mode in test.sh, and update code coverage on the repo. See : https://github.com/marketplace/actions/coveralls-github-action --- .github/workflows/test.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 538f9c7..1b36152 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,4 +24,15 @@ jobs: id: go - uses: actions/checkout@v1 - name: Run tests - run: go test ./... -race + run: | + go test ./... -v -race -coverprofile cover.out -covermode=atomic + - name: Convert coverage to lcov + uses: jandelgado/gcov2lcov-action@v1.0.0 + with: + infile: cover.out + outfile: coverage.lcov + - name: Coveralls + uses: coverallsapp/github-action@v1.0.1 + with: + github-token: ${{ secrets.github_token }} + path-to-lcov: coverage.lcov