version: "3"
tasks:
run-host:
internal: true
cmds:
- mv .cargo/config.toml .cargo/config.toml.bck
- defer: mv .cargo/config.toml.bck .cargo/config.toml
- cargo {{.COMMAND}}
run-web:
internal: true
cmds:
- mv .cargo/config.toml .cargo/config.toml.bck
- defer: mv .cargo/config.toml.bck .cargo/config.toml
- mv rust-toolchain.toml rust-toolchain.toml.bck
- defer: mv rust-toolchain.toml.bck rust-toolchain.toml
- cargo {{.COMMAND}} --target wasm32-unknown-unknown
build-esp:
- cargo build
build-host:
- task: run-host
vars: { COMMAND: build }
build-web:
- task: run-web
vars: { COMMAND: build }
test-host:
cmds:
- task: run-host
vars: { COMMAND: test }
test:
- task: build-esp
- task: build-host
- task: test-host
lint-esp:
cmds:
- cargo clippy
lint-host:
cmds:
- task: run-host
vars: { COMMAND: clippy }
lint:
- task: lint-esp
- task: lint-host
format:
desc: run code formatters
cmds:
- cargo fmt
release:
desc: build and publish release
cmds:
- test {{.CLI_ARGS}}
- grep -F '"{{.CLI_ARGS}}"' Cargo.toml
- cargo publish
- git tag {{.CLI_ARGS}}
- git push
- git push --tags
- gh release create --generate-notes {{.CLI_ARGS}}
all:
cmds:
- task: format
- task: lint
- task: test