diff options
author | Sam Scott <sam@osohq.com> | 2020-12-06 21:55:11 -0500 |
---|---|---|
committer | Sam Scott <sam@osohq.com> | 2020-12-06 21:57:11 -0500 |
commit | fb2dc95c516f3dc721467d7dd09def779abcfd31 (patch) | |
tree | d9c74fd27e7557eb3b89fcea1a9a704b77ce49aa | |
parent | 7dc1b7c86749cbbe50a308e73469659232d9a3bb (diff) |
Add GitHub Actions.
-rw-r--r-- | .github/workflows/ci.yml | 47 | ||||
-rw-r--r-- | .travis.yml | 15 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | examples/introduction.rs | 8 |
4 files changed, 54 insertions, 22 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b6429ef --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: Rust CI checks +on: + push: + +jobs: + lint: + name: Run lint checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + - name: Check Rust formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + - name: Check clippy + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-targets -- -D warnings + + test: + name: Run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-test-${{ hashFiles('Cargo.toml') }} + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Run test + run: cargo test --all-targets --features actix diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f698d07..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly -matrix: - allow_failures: - - rust: nightly -env: - - ARGS="--verbose" - - ARGS="--verbose --features=actix" - -script: - - cargo build $ARGS - - cargo test $ARGS @@ -1,8 +1,8 @@ -# Serde Querystrings [![Build Status]][travis] [![Latest Version]][crates.io] [![Documentation]][docs-rs] +# Serde Querystrings [![badge-ci]][badge-ci-link] [![Latest Version]][crates.io] [![Documentation]][docs-rs] -[Build Status]: https://api.travis-ci.org/samscott89/serde_qs.svg?branch=master -[travis]: https://travis-ci.org/samscott89/serde_qs +[badge-ci]: https://github.com/samscott89/serde_qs/workflows/Rust%20CI%20checks/badge.svg +[badge-ci-link]: https://github.com/samscott89/serde_qs/actions?query=workflow%3A%22Rust+CI+checks%22+branch%3Amain [Latest Version]: https://img.shields.io/crates/v/serde_qs.svg [crates.io]: https://crates.io/crates/serde\_qs [Documentation]: https://docs.rs/serde_qs/badge.svg diff --git a/examples/introduction.rs b/examples/introduction.rs index fb91b3e..10e7a8b 100644 --- a/examples/introduction.rs +++ b/examples/introduction.rs @@ -59,7 +59,7 @@ fn main() { // In this form, can also simply use `serde_urlencoded`: let encoded = urlencoded::to_string(&map).unwrap(); println!("`serde_urlencoded` to_string for map:\n\t{}", encoded); - println!(""); + println!(); // Given this encoded string, you can recover the original map // as a list of pairs using serde_urlencoded: @@ -80,7 +80,7 @@ fn main() { // Similarly, we can serialize this structure using `serde_qs`: let encoded = qs::to_string(¶ms).unwrap(); println!("`serde_qs` to_string for struct:\n\t{:?}", encoded); - println!(""); + println!(); // One nice feature is that this gives deterministic encodings: let encoded2 = qs::to_string(¶ms).unwrap(); @@ -160,7 +160,7 @@ fn main() { println!("`serde_qs` to_string for enum:\n\t{:?}", encoded); let params: EnumQuery = qs::from_str(&encoded).unwrap(); println!("`serde_qs` from_str for enum:\n\t{:?}", params); - println!(""); + println!(); let example_params = EnumQuery { e: AdjTaggedEnum::A, @@ -171,5 +171,5 @@ fn main() { println!("`serde_qs` to_string for enum:\n\t{:?}", encoded); let params: EnumQuery = qs::from_str(&encoded).unwrap(); println!("`serde_qs` from_str for enum:\n\t{:?}", params); - println!(""); + println!(); } |