Skip to content

Commit

Permalink
github workflows: add coveralls for test coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
sloorush committed Sep 16, 2021
1 parent 04aac05 commit 0ea27cb
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,70 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10
steps:

- name: setup directory
shell: bash
run: |
mkdir -p "${{ github.workspace }}/testdatapath"
# set GOPATH
- name: setup env
shell: bash
run: |
echo "${{ github.workspace }}/go/bin:" >> $GITHUB_PATH
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
- name: Install Go
if: success()
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
path: go/src/github.com/${{ github.repository }}

- name: Get dependencies
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
go get -v -d ./...
- name: Build
shell: bash
run: |
cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoserver
go build -v
- name: Build
shell: bash
run: |
cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoclient
go build -v
- name: Run unit tests
shell: bash
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
go test -v ./accumulator
go test -v ./accumulator -race -covermode atomic -coverprofile=covprofile
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: "covprofile"
working-directory: "${{ github.workspace }}/go/src/github.com/${{ github.repository }}"

- name: Run integration tests
shell: bash
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
./test/install_bitcoind.sh
./test/csn_bridge.sh "./cmd/utreexoserver/utreexoserver" "./cmd/utreexoclient/utreexoclient" "${{ github.workspace }}/testdatapath"
- name: Upload testdata
uses: actions/upload-artifact@v2
with:
Expand All @@ -74,13 +80,14 @@ jobs:
needs: Build
timeout-minutes: 5
steps:

# set GOPATH
- name: setup env
shell: bash
run: |
echo "${{ github.workspace }}/go/bin:" >> $GITHUB_PATH
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
- uses: actions/download-artifact@v2
with:
name: testdatapath
Expand Down Expand Up @@ -108,7 +115,7 @@ jobs:
run: |
cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoserver
go install -v
- name: checkout
uses: actions/checkout@v2
with:
Expand Down

0 comments on commit 0ea27cb

Please sign in to comment.