Add rustfmt make command and CI configure

This commit is contained in:
Brandon Fish
2018-12-15 00:45:03 -06:00
parent f51362be66
commit f651a47007
2 changed files with 14 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ jobs:
- v4-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
- run: sudo apt-get install -y cmake
- run: make test
- run: rustup component add rustfmt
- run: make lint
- save_cache:
paths:
- /usr/local/cargo/registry
@@ -45,6 +47,10 @@ jobs:
- run:
name: Execute tests
command: make test
- run: rustup component add rustfmt
- run:
name: Execute lints
command: make lint
- run:
name: Make release build
command: |
@@ -97,12 +103,14 @@ jobs:
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
cargo --version
rustup component add rustfmt
- run:
name: Execute tests
command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
make test
make lint
- run:
name: Make release build
command: |

View File

@@ -3,7 +3,7 @@ ifeq (test, $(firstword $(MAKECMDGOALS)))
$(eval $(runargs):;@true)
endif
.PHONY: spectests emtests clean build install
.PHONY: spectests emtests clean build install lint precommit
# This will re-generate the Rust test files based on spectests/*.wast
spectests:
@@ -21,6 +21,11 @@ build:
install:
cargo install --path .
lint:
cargo fmt -- --check
precommit: lint test
test:
# We use one thread so the emscripten stdouts doesn't collide
cargo test -- --test-threads=1 $(runargs)