-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some unit tests and a workflow to run tests in pull requests.
Signed-off-by: bin liu <[email protected]>
- Loading branch information
Showing
6 changed files
with
274 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- reopened | ||
- synchronize | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUST_TARGET: x86_64-unknown-linux-musl | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and test | ||
uses: gmiam/rust-musl-action@master | ||
with: | ||
args: make build && make ut |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ serde_json = "1.0" | |
structopt = "0.3" | ||
toml_edit = "0.15.0" | ||
chrono = "0.4" | ||
|
||
[dev-dependencies] | ||
tempfile = "3.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
default: build | ||
|
||
CARGO ?= $(shell which cargo) | ||
RUST_TARGET ?= x86_64-unknown-linux-musl | ||
|
||
.format: | ||
${CARGO} fmt -- --check | ||
|
||
build: .format | ||
${CARGO} build --target ${RUST_TARGET} --release | ||
# Cargo will skip checking if it is already checked | ||
${CARGO} clippy --bins --tests -- -Dwarnings | ||
|
||
clean: | ||
${CARGO} clean | ||
|
||
ut: | ||
RUST_BACKTRACE=1 ${CARGO} test --workspace -- --skip integration --nocapture | ||
|
||
integration: | ||
# run tests under `test` directory | ||
RUST_BACKTRACE=1 ${CARGO} test --workspace -- integration --nocapture | ||
|
||
test: ut integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters