diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9924129 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +# Largely built from this excellent guide: +# https://shift.click/blog/github-actions-rust/#run-on-pushes-to-main--prs-to-main-or-dev + +name: Test + +env: + RUST_BACKTRACE: 1 + CARGO_INCREMENTAL: 0 + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + name: ${{ matrix.rust }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - { rust: stable, os: ubuntu-latest } + - { rust: nightly, os: ubuntu-latest } + steps: + - uses: actions/checkout@v2 + + - uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.rust }} + components: clippy, rustfmt + + - uses: Swatinem/rust-cache@v1 + + - run: cargo test + - run: cargo clippy + - run: cargo fmt -- --check diff --git a/README.md b/README.md index b03259f..c6cd527 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # tcp-channel -[![Crates.io](http://meritbadge.herokuapp.com/tcp-channel)](https://crates.io/crates/tcp-channel) -[![Docs.rs](https://docs.rs/tcp-channel/badge.svg)](https://docs.rs/tcp-channel) -[![Build Status](https://travis-ci.org/4lDO2/tcp-channel.svg?branch=master)](https://travis-ci.org/4lDO2/tcp-channel) +[![crates.io](https://img.shields.io/crates/v/tcp-channel.svg)](https://crates.io/crates/tcp-channel) +[![Released API docs](https://docs.rs/tcp-channel/badge.svg)](https://docs.rs/tcp-channel) +[![Test](https://github.com/4lDO2/tcp-channel/actions/workflows/test.yml/badge.svg)](https://github.com/4lDO2/tcp-channel/actions/workflows/test.yml) SPSC channels in Rust, transmitted through anything that implements `Read` and `Write`. It uses `bincode` and `serde` for serialization and deserialization.