2020-04-01 22:38:29 +00:00
|
|
|
version: 2.1
|
|
|
|
orbs:
|
|
|
|
go: gotest/tools@0.0.9
|
|
|
|
executors:
|
|
|
|
golang:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.13
|
|
|
|
resource_class: 2xlarge
|
|
|
|
commands:
|
2020-04-01 23:11:32 +00:00
|
|
|
prepare-git-checkout:
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: git submodule sync
|
|
|
|
- run: git submodule update --init --recursive
|
2020-04-01 22:38:29 +00:00
|
|
|
install-build-dependencies:
|
|
|
|
steps:
|
|
|
|
- run: sudo apt-get update
|
|
|
|
- run: sudo apt-get install -y jq ocl-icd-opencl-dev
|
|
|
|
- run: ./extern/filecoin-ffi/install-filcrypto
|
|
|
|
download-groth-params-and-verifying-keys:
|
|
|
|
steps:
|
|
|
|
- restore_cache:
|
|
|
|
name: Restore parameters cache
|
|
|
|
keys:
|
|
|
|
- 'v24-2k-lotus-params'
|
|
|
|
paths:
|
|
|
|
- /var/tmp/filecoin-proof-parameters/
|
|
|
|
- run: |
|
|
|
|
DIR=$(pwd)
|
|
|
|
cd $(mktemp -d)
|
|
|
|
go get github.com/filecoin-project/go-paramfetch/paramfetch
|
|
|
|
go build -o go-paramfetch github.com/filecoin-project/go-paramfetch/paramfetch
|
|
|
|
./go-paramfetch 2048 "${DIR}/parameters.json"
|
|
|
|
- save_cache:
|
|
|
|
name: Save parameters cache
|
|
|
|
key: 'v24-2k-lotus-params'
|
|
|
|
paths:
|
|
|
|
- /var/tmp/filecoin-proof-parameters/
|
|
|
|
jobs:
|
2020-04-01 23:07:34 +00:00
|
|
|
test:
|
2020-04-01 22:38:29 +00:00
|
|
|
executor: golang
|
2020-04-01 23:07:34 +00:00
|
|
|
environment:
|
|
|
|
RUST_LOG: info
|
2020-04-01 22:38:29 +00:00
|
|
|
steps:
|
2020-04-01 23:11:32 +00:00
|
|
|
- prepare-git-checkout
|
2020-04-01 22:38:29 +00:00
|
|
|
- install-build-dependencies
|
|
|
|
- download-groth-params-and-verifying-keys
|
2020-04-01 23:07:34 +00:00
|
|
|
- run: go test -v -timeout 10m ./...
|
|
|
|
mod-tidy-check:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
2020-04-01 23:11:32 +00:00
|
|
|
- prepare-git-checkout
|
2020-04-01 22:38:29 +00:00
|
|
|
- go/mod-download
|
|
|
|
- go/mod-tidy-check
|
2020-04-01 23:07:34 +00:00
|
|
|
gofmt-check:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
2020-04-01 23:11:32 +00:00
|
|
|
- prepare-git-checkout
|
2020-04-01 23:07:34 +00:00
|
|
|
- go/mod-download
|
|
|
|
- run:
|
|
|
|
command: "! go fmt ./... 2>&1 | read"
|
|
|
|
lint-check:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
2020-04-01 23:11:32 +00:00
|
|
|
- prepare-git-checkout
|
2020-04-01 23:13:20 +00:00
|
|
|
- install-build-dependencies
|
2020-04-01 23:07:34 +00:00
|
|
|
- go/mod-download
|
|
|
|
- go/install-golangci-lint:
|
|
|
|
gobin: $HOME/.local/bin
|
|
|
|
version: 1.23.8
|
|
|
|
- run:
|
|
|
|
command: $HOME/.local/bin/golangci-lint run -v --concurrency 2
|
2020-04-01 22:38:29 +00:00
|
|
|
workflows:
|
|
|
|
version: 2.1
|
|
|
|
build_and_test:
|
|
|
|
jobs:
|
|
|
|
- mod-tidy-check
|
2020-04-01 23:07:34 +00:00
|
|
|
- lint-check
|
|
|
|
- gofmt-check
|
|
|
|
- test
|