Run cli docsgen in CI

This commit is contained in:
Łukasz Magiera 2021-04-29 20:01:23 +02:00
parent 483478d511
commit ed08366cac
7 changed files with 24 additions and 6 deletions

View File

@ -436,7 +436,7 @@ jobs:
- run:
command: "! go fmt ./... 2>&1 | read"
cbor-gen-check:
gen-check:
executor: golang
steps:
- install-deps
@ -444,7 +444,10 @@ jobs:
- run: make deps
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make type-gen
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet
@ -701,7 +704,7 @@ workflows:
concurrency: "16" # expend all docker 2xlarge CPUs.
- mod-tidy-check
- gofmt
- cbor-gen-check
- gen-check
- docs-check
- test:
codecov-upload: true

View File

@ -368,7 +368,13 @@ docsgen-openrpc-worker: docsgen-openrpc-bin
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
gen: type-gen method-gen docsgen api-gen
@echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
.PHONY: gen
# separate from gen because it needs binaries
docsgen-cli: lotus lotus-miner lotus-worker
python ./scripts/generate-lotus-cli.py
.PHONY: docsgen-cli
print-%:
@echo $*=$($*)

View File

@ -1,8 +1,16 @@
package build
import "os"
var CurrentCommit string
var BuildType int
func init() {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
CurrentCommit = ""
}
}
const (
BuildDefault = 0
BuildMainnet = 0x1

View File

@ -7,7 +7,7 @@ USAGE:
lotus-miner [global options] command [command options] [arguments...]
VERSION:
1.11.0-dev+mainnet+git.12867a567.dirty
1.11.0-dev+mainnet
COMMANDS:
init Initialize a lotus miner repo

View File

@ -7,7 +7,7 @@ USAGE:
lotus-worker [global options] command [command options] [arguments...]
VERSION:
1.11.0-dev+2k+git.ac39417f4.dirty
1.11.0-dev+mainnet
COMMANDS:
run Start lotus worker

View File

@ -7,7 +7,7 @@ USAGE:
lotus [global options] command [command options] [arguments...]
VERSION:
1.11.0-dev+mainnet+git.12867a567.dirty
1.11.0-dev+mainnet
COMMANDS:
daemon Start a lotus daemon process

View File

@ -46,6 +46,7 @@ def generate_lotus_cli(prog):
if __name__ == "__main__":
os.putenv("LOTUS_VERSION_IGNORE_COMMIT", "1")
generate_lotus_cli('lotus')
generate_lotus_cli('lotus-miner')
generate_lotus_cli('lotus-worker')