From 0c822237f3d64e26e5826df0f919520afbb68eda Mon Sep 17 00:00:00 2001 From: r-ush Date: Thu, 9 Sep 2021 10:47:26 +0530 Subject: [PATCH] github workflows: add coveralls for test coverage reports --- .github/workflows/go.yml | 209 +++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 108 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 68c4c40b..e48a0ce8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -4,69 +4,65 @@ 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 - - - 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: - name: testdatapath - path: "${{ github.workspace }}/testdatapath" + - 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 -race -covermode atomic -coverprofile=covprofile + - name: Send coverage + uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: "$GOPATH/src/github.com/${{ github.repository }}/covprofile" + - 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: + name: testdatapath + path: "${{ github.workspace }}/testdatapath" check-proof-backwards: name: Check proof backwards compatibility @@ -74,49 +70,46 @@ 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 - - - name: Install Go - if: success() - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - - name: checkout - uses: actions/checkout@v2 - with: - ref: master - 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 install -v - - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 1 - path: go/src/github.com/${{ github.repository }} - - - name: Check backwards - shell: bash - run: | - cd $GOPATH/src/github.com/${{ github.repository }} - ./test/check_proofs_backwards.sh utreexoserver "${{ github.workspace }}" + # 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 + + - name: Install Go + if: success() + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + + - name: checkout + uses: actions/checkout@v2 + with: + ref: master + 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 install -v + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + path: go/src/github.com/${{ github.repository }} + + - name: Check backwards + shell: bash + run: | + cd $GOPATH/src/github.com/${{ github.repository }} + ./test/check_proofs_backwards.sh utreexoserver "${{ github.workspace }}"