Files
coreth/Taskfile.yml

121 lines
3.8 KiB
YAML

# https://taskfile.dev
# To run on a system without task installed, `./scripts/run_task.sh` will execute it with `go run`.
# If in the nix dev shell, `task` is available.
version: '3'
env:
BASEDIR: '{{.BASEDIR | default "/tmp/e2e-test"}}'
LUXD_BUILD_PATH: '{{.LUXD_BUILD_PATH | default "/tmp/e2e-test/luxd"}}'
DATA_DIR: '{{.DATA_DIR | default "/tmp/e2e-test/coreth-data"}}'
tasks:
default: ./scripts/run_task.sh --list
actionlint:
desc: Validate GitHub Actions workflows and ensure scripts use run_task.sh for reproducibility
cmd: ./scripts/actionlint.sh # ci.yml
build:
desc: Compile Coreth binary with git commit and static linking flags
cmd: ./scripts/build.sh # ci.yml
build-luxd-with-coreth:
desc: Build Luxd binary with Coreth dependency pointing to local Coreth path
cmd: ./scripts/build_luxd_with_coreth.sh # ci.yml
build-test:
desc: Run all Go tests with retry logic for flaky tests, race detection, and coverage reporting
cmd: ./scripts/build_test.sh # ci.yml
check-luxd-version:
desc: Ensure consistent luxd version by updating and checking for changes
cmds:
- task: update-luxd-version
- cmd: git diff --exit-code
check-clean-branch:
desc: Checks that the git working tree is clean
cmds:
- cmd: git add --all
- cmd: git update-index --really-refresh >> /dev/null
- cmd: git status --short # Show the status of the working tree.
- cmd: git diff-index --quiet HEAD # Exits if any uncommitted changes are found.
check-generate-codec:
desc: Checks that generated codec files are up-to-date (requires a clean git working tree)
cmds:
- task: generate-codec
- task: check-clean-branch
check-generate-mocks:
desc: Checks that generated mocks are up-to-date (requires a clean git working tree)
cmds:
- task: generate-mocks
- task: check-clean-branch
check-go-mod-tidy:
desc: Checks that go.mod and go.sum are up-to-date (requires a clean git working tree)
cmds:
- cmd: go mod tidy
- task: check-clean-branch
coverage:
desc: Display test coverage statistics from coverage.out file
cmd: ./scripts/coverage.sh # ci.yml
generate-codec:
desc: Generates fjl/gencodec files
cmds:
- cmd: grep -lr -E '^// Code generated by github\.com\/fjl\/gencodec\. DO NOT EDIT\.$' . | xargs -r rm
- cmd: go generate -run "github.com/fjl/gencodec" ./...
generate-mocks:
desc: Generates testing mocks
cmds:
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
- cmd: go generate -run "go.uber.org/mock/mockgen" ./...
lint:
desc: Run golangci-lint and check for allowed Ethereum imports in Go code
cmd: ./scripts/lint.sh
lint-all:
desc: Runs all lint checks in parallel
deps:
- lint
- actionlint
- shellcheck
- check-generate-codec
- check-generate-mocks
lint-all-ci:
desc: Runs all lint checks one-by-one
cmds:
- task: lint
- task: actionlint
- task: shellcheck
- task: check-generate-codec
- task: check-generate-mocks
shellcheck:
desc: Run shellcheck static analysis on all shell scripts with version management
cmd: ./scripts/shellcheck.sh # ci.yml
test-e2e:
desc: Run Luxd e2e tests from target version against current state of coreth
cmd: ./scripts/tests.e2e.sh # ci.yml
test-e2e-warp:
desc: Run end-to-end warp tests using Ginkgo test framework
cmd: ./scripts/run_ginkgo_warp.sh # ci.yml
test-e2e-warp-ci: # consolidated test-e2e-warp
desc: Run E2E warp tests with CI setup
cmds:
- task: build
- task: test-e2e-warp
update-luxd-version:
desc: Update Luxd version in go.mod and sync GitHub Actions workflow custom action version
cmd: bash -x ./scripts/update_luxd_version.sh # ci.yml