Skip to content

CI: add test workflow #559

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

Merged
merged 20 commits into from
Oct 13, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Cleanup
  • Loading branch information
Maurizio Branca committed Oct 13, 2020
commit c47053eb518a62463c22e8666fa887b17f50937e
167 changes: 0 additions & 167 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,6 @@
version: "2"

tasks:
# docs:gen:commands:
# desc: Generate command reference files
# dir: ./docsgen
# cmds:
# # docs will generate examples using os.Args[0] so we need to call
# # the generator `arduino-cli`
# - go build -o arduino-cli
# # we invoke `arduino-cli` like this instead of `./arduino-cli` to remove
# # the `./` chars from the examples
# - PATH=. arduino-cli ../docs/commands
# - task: docs:format

# docs:gen:protobuf:
# desc: Generate markdown contents for protobuffers
# cmds:
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,commands.md --proto_path=rpc ./rpc/commands/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,monitor.md --proto_path=rpc ./rpc/monitor/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,settings.md --proto_path=rpc ./rpc/settings/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,debug.md --proto_path=rpc ./rpc/debug/*.proto'
# - task: docs:format

# docs:gen:
# desc: Generate documentation files
# cmds:
# - task: docs:gen:commands
# - task: docs:gen:protobuf

# docs:build:
# desc: Build documentation website contents
# deps:
# - docs:gen:commands
# - docs:gen:protobuf
# cmds:
# - mkdocs build -s

# docs:publish:
# desc: Use Mike to build and push versioned docs
# deps:
# - docs:gen:commands
# - docs:gen:protobuf
# cmds:
# - mike deploy -u -p -r {{.DOCS_REMOTE}} {{.DOCS_VERSION}} {{.DOCS_ALIAS}}

# docs:serve:
# desc: Run documentation website locally
# deps:
# - docs:build
# cmds:
# - mkdocs serve

# docs:check:
# desc: Run documentation linting
# cmds:
# - npx {{ .PRETTIER }} --check "**/*.md"

# docs:check-links:
# desc: Verifies there are no dead links in documentation
# cmds:
# - |
# npx -p markdown-link-check -c '
# STATUS=0
# for file in $(find -name "*.md"); do
# markdown-link-check -c markdown-link-check-config.json -q "$file"
# STATUS=$(( $STATUS + $? ))
# done
# exit $STATUS'

# docs:format:
# desc: Automatically formats documentation
# cmds:
# - npx {{ .PRETTIER }} --write "**/*.md"

# protoc:
# desc: Compile protobuf definitions
# cmds:
# - '{{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/commands/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/monitor/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/settings/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/debug/*.proto'

# protoc:docs:
# desc: Generate docs for protobuf definitions
# cmds:
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,commands.md --proto_path=rpc ./rpc/commands/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,monitor.md --proto_path=rpc ./rpc/monitor/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,settings.md --proto_path=rpc ./rpc/settings/*.proto'
# - '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,debug.md --proto_path=rpc ./rpc/debug/*.proto'

build:
desc: Build the project
Expand All @@ -98,29 +11,12 @@ tasks:
desc: Run the full testsuite, `legacy` will be skipped
cmds:
- task: test-unit
# - task: test-integration

test-unit:
desc: Run unit tests only
cmds:
- go test -short -run '{{ default ".*" .TEST_REGEX }}' {{ default "-v" .GOFLAGS }} -coverprofile=coverage_unit.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}

# test-integration:
# desc: Run integration tests only
# cmds:
# - poetry install --no-root
# - poetry run pytest test

# test-legacy:
# desc: Run tests for the `legacy` package
# cmds:
# - go test {{ default "-v -failfast" .GOFLAGS }} -coverprofile=coverage_legacy.txt ./legacy/...

# test-unit-race:
# desc: Run unit tests only with race condition detection
# cmds:
# - go test -short -race {{ default "-v" .GOFLAGS }} -coverprofile=coverage_race_unit.txt {{ default .DEFAULT_TARGETS .TARGETS }}

check:
desc: Check fmt and lint
cmds:
Expand All @@ -138,69 +34,6 @@ tasks:
# - task: docs:check
# - task: config:check

# config:check:
# desc: Check linting of configuration and supporting files
# cmds:
# - npx {{ .PRETTIER }} --check "**/*.{yml,yaml}"

# config:format:
# desc: Automatically formats configuration and supporting files
# cmds:
# - npx {{ .PRETTIER }} --write "**/*.{yml,yaml}"

# python:check:
# desc: Linting for Python files
# cmds:
# - poetry install --no-root
# - poetry run flake8

# python:format:
# desc: Automatically formats Python files
# cmds:
# - poetry install --no-root
# - poetry run black .

# check-legacy:
# desc: Check fmt and lint for the `legacy` package
# cmds:
# - test -z $(go fmt ./legacy/...)
# - go vet ./legacy/...

# rpc-client:
# desc: Run the rpc client test routine (server must be already started)
# cmds:
# - go test -run TestWithClientE2E ./commands/daemon

# i18n:update:
# desc: Updates i18n files
# cmds:
# - go run ./i18n/cmd/main.go catalog generate . > ./i18n/data/en.po
# - task: i18n:generate

# i18n:pull:
# desc: Pull i18n files from transifex
# cmds:
# - go run ./i18n/cmd/main.go transifex pull ./i18n/data
# - task: i18n:generate

# i18n:push:
# desc: Push i18n files to transifex
# cmds:
# - go run ./i18n/cmd/main.go transifex push ./i18n/data

# i18n:check:
# desc: Check if the i18n message catalog was updated
# cmds:
# - task: i18n:update
# - git add -N ./i18n/data
# - git diff --exit-code ./i18n/data

# i18n:generate:
# desc: Generate embedded i18n catalog files
# cmds:
# - git add -N ./i18n/data
# - git diff --exit-code ./i18n/data &> /dev/null || (cd ./i18n && rice embed-go)

vars:
# all modules of this project except for "gen/..." module
DEFAULT_TARGETS:
Expand Down