Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Harmony(ONE) #95

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
231 changes: 231 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down Expand Up @@ -83,6 +84,21 @@ jobs:
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand Down Expand Up @@ -159,6 +175,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down Expand Up @@ -197,6 +214,21 @@ jobs:
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand Down Expand Up @@ -284,6 +316,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down Expand Up @@ -322,6 +355,21 @@ jobs:
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand Down Expand Up @@ -408,6 +456,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down Expand Up @@ -446,6 +495,21 @@ jobs:
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand Down Expand Up @@ -532,6 +596,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down Expand Up @@ -570,6 +635,21 @@ jobs:
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand Down Expand Up @@ -656,6 +736,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down Expand Up @@ -694,6 +775,21 @@ jobs:
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand Down Expand Up @@ -736,3 +832,138 @@ jobs:
-btc=true \
-bch=true \
-timeout 1500s

test-harmony:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
submodules: recursive

- name: Caching modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-aw-${{ hashFiles('**/go.sum') }}

- name: Cache extern dependencies (FFI)
id: cache-extern
uses: actions/cache@v2
env:
cache-name: cache-externs
with:
path: .extern
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.FILECOIN_FFI_COMMIT }}-${{ env.SOLANA_FFI_COMMIT }}

# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Install dependency packages
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt install libgmp-dev libssl-dev make gcc g++
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

- name: Get dependencies
run: |
export PATH=$PATH:$(go env GOPATH)/bin
source $HOME/.cargo/env
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/onsi/gomega/...
go get -u golang.org/x/lint/golint
go get -u github.com/loongy/covermerge
go get -u github.com/mattn/goveralls
go get -u github.com/xlab/c-for-go

- name: Install dependencies (Filecoin FFI)
if: steps.cache-extern.outputs.cache-hit != 'true'
run: |
export PATH=$PATH:$(go env GOPATH)/bin
source $HOME/.cargo/env
cd $GITHUB_WORKSPACE
mkdir .extern && cd .extern
git clone https://github.com/filecoin-project/filecoin-ffi.git
cd filecoin-ffi
git checkout ${{ env.FILECOIN_FFI_COMMIT }}
make

- name: Install dependencies (Solana FFI)
if: steps.cache-extern.outputs.cache-hit != 'true'
run: |
export PATH=$PATH:$(go env GOPATH)/bin
source $HOME/.cargo/env
cd $GITHUB_WORKSPACE/.extern
git clone https://github.com/renproject/solana-ffi.git
cd solana-ffi
git checkout ${{ env.SOLANA_FFI_COMMIT }}
make clean
make

- name: Install dependencies (Harmony)
run: |
cd $GITHUB_WORKSPACE/chain/harmony
git clone https://github.com/harmony-one/bls.git
git clone https://github.com/harmony-one/mcl.git
cd $GITHUB_WORKSPACE/chain/harmony/bls
make
cd $GITHUB_WORKSPACE
export CGO_CFLAGS="-I$GITHUB_WORKSPACE/chain/harmony/bls/include -I$GITHUB_WORKSPACE/chain/harmony/mcl/include -I/usr/local/opt/openssl/include"
export CGO_LDFLAGS="-L$GITHUB_WORKSPACE/chain/harmony/bls/lib -L/usr/local/opt/openssl/lib"
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/chain/harmony/bls/lib:$GITHUB_WORKSPACE/chain/harmony/mcl/lib:/usr/local/opt/openssl/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
export GO111MODULE=on

- name: Run vetting
run: |
export PATH=$PATH:$(go env GOPATH)/bin
source $HOME/.cargo/env
go mod edit -replace=github.com/filecoin-project/filecoin-ffi=./.extern/filecoin-ffi
go mod edit -replace=github.com/renproject/solana-ffi=./.extern/solana-ffi
go vet ./...

- name: Run linting
run: |
cd $GITHUB_WORKSPACE
export PATH=$PATH:$(go env GOPATH)/bin
go get -u golang.org/x/lint/golint
golint $(go list ./... | grep -v filecoin-ffi)

- name: Run multichain infrastructure
run: |
cd $GITHUB_WORKSPACE/infra
source .env
docker-compose up -d --build \
harmony

- name: Sleep until the nodes are up
uses: jakejarvis/wait-action@master
with:
time: '1m'

- name: Check on docker containers
run: docker ps -a

- name: Run tests and report test coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export PATH=$PATH:$(go env GOPATH)/bin
source ./infra/.env
cd $GITHUB_WORKSPACE
go test \
-one=true \
-timeout 1500s
Loading