diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 9c90947b..b0ff3395 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -10,6 +10,7 @@ jobs: with: toolchain: nightly components: clippy + profile: minimal override: true - uses: actions-rs/clippy-check@v1 with: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..4c8839bd --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,77 @@ +name: CI (Linux) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - 1.39.0 + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-unknown-linux-gnu + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture + + - name: Generate coverage file + if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml --workspace --all-features + + - name: Upload to Codecov + if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: cobertura.xml + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml index 1d23ec86..c036d9b5 100644 --- a/.github/workflows/windows-mingw.yml +++ b/.github/workflows/windows-mingw.yml @@ -1,4 +1,4 @@ -name: CI (Windows-gnu) +name: CI (Windows-mingw) on: [push, pull_request] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5e18c3f6..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -language: rust -sudo: required -dist: trusty - -cache: - cargo: true - apt: true - -matrix: - include: - - rust: stable - - rust: beta - - rust: nightly-2019-11-07 - allow_failures: - - rust: nightly-2019-11-07 - -env: - global: - - RUSTFLAGS="-C link-dead-code" - - OPENSSL_VERSION=openssl-1.0.2 - -before_install: - - sudo add-apt-repository -y ppa:0k53d-karl-f830m/openssl - - sudo apt-get update -qq - - sudo apt-get install -y openssl libssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev - -before_cache: | - if [[ "$TRAVIS_RUST_VERSION" == "nightly-2019-11-07" ]]; then - RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install --version 0.6.11 cargo-tarpaulin - fi - -# Add clippy -before_script: - - export PATH=$PATH:~/.cargo/bin - -script: - - | - if [[ "$TRAVIS_RUST_VERSION" != "nightly-2019-11-07" ]]; then - cargo clean - cargo test --all --all-features -- --nocapture - fi - -after_success: - - | - if [[ "$TRAVIS_RUST_VERSION" == "nightly-2019-11-07" ]]; then - taskset -c 0 cargo tarpaulin --all --all-features --out Xml - echo "Uploaded code coverage" - bash <(curl -s https://codecov.io/bash) - fi diff --git a/README.md b/README.md index 426cf6d6..b291fd13 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,16 @@ -# Actix net [![Build Status](https://travis-ci.org/actix/actix-net.svg?branch=master)](https://travis-ci.org/actix/actix-net) [![codecov](https://codecov.io/gh/actix/actix-net/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-net) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +# Actix net [![codecov](https://codecov.io/gh/actix/actix-net/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-net) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Actix net - framework for composable network services +## Build statuses + +| Platform | Build Status | +| ---------------- | ------------ | +| Linux | [![build status](https://github.com/actix/actix-net/workflows/CI%20%28Linux%29/badge.svg?branch=master&event=push)](https://github.com/actix/actix-net/actions?query=workflow%3A"CI+(Linux)") | +| macOS | [![build status](https://github.com/actix/actix-net/workflows/CI%20%28macOS%29/badge.svg?branch=master&event=push)](https://github.com/actix/actix-net/actions?query=workflow%3A"CI+(macOS)") | +| Windows | [![build status](https://github.com/actix/actix-net/workflows/CI%20%28Windows%29/badge.svg?branch=master&event=push)](https://github.com/actix/actix-net/actions?query=workflow%3A"CI+(Windows)") | +| Windows (MinGW) | [![build status](https://github.com/actix/actix-net/workflows/CI%20%28Windows-mingw%29/badge.svg?branch=master&event=push)](https://github.com/actix/actix-net/actions?query=workflow%3A"CI+(Windows-mingw)") | + ## Documentation & community resources * [Chat on gitter](https://gitter.im/actix/actix) diff --git a/actix-server/tests/test_server.rs b/actix-server/tests/test_server.rs index 46587a80..c5aa70bc 100644 --- a/actix-server/tests/test_server.rs +++ b/actix-server/tests/test_server.rs @@ -1,15 +1,10 @@ -use std::io::Read; use std::sync::atomic::{AtomicUsize, Ordering::Relaxed}; use std::sync::{mpsc, Arc}; use std::{net, thread, time}; -use actix_codec::{BytesCodec, Framed}; -use actix_rt::net::TcpStream; use actix_server::Server; use actix_service::fn_service; -use bytes::Bytes; use futures::future::{lazy, ok}; -use futures::SinkExt; use net2::TcpBuilder; fn unused_addr() -> net::SocketAddr { @@ -73,6 +68,12 @@ fn test_listen() { #[test] #[cfg(unix)] fn test_start() { + use actix_codec::{BytesCodec, Framed}; + use actix_rt::net::TcpStream; + use bytes::Bytes; + use futures::SinkExt; + use std::io::Read; + let addr = unused_addr(); let (tx, rx) = mpsc::channel(); diff --git a/actix-service/Cargo.toml b/actix-service/Cargo.toml index 1825a6e6..e4e3e0b8 100644 --- a/actix-service/Cargo.toml +++ b/actix-service/Cargo.toml @@ -11,10 +11,6 @@ categories = ["network-programming", "asynchronous"] license = "MIT/Apache-2.0" edition = "2018" -[badges] -travis-ci = { repository = "actix/actix-service", branch = "master" } -codecov = { repository = "actix/actix-service", branch = "master", service = "github" } - [lib] name = "actix_service" path = "src/lib.rs" diff --git a/router/CHANGES.txt b/router/CHANGES.md similarity index 100% rename from router/CHANGES.txt rename to router/CHANGES.md