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 9, 2021
1 parent 04aac05 commit 0c82223
Showing 1 changed file with 101 additions and 108 deletions.
209 changes: 101 additions & 108 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,119 +4,112 @@ 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
runs-on: ubuntu-latest
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 }}"

0 comments on commit 0c82223

Please sign in to comment.