From 37b66e89810f6d3d5a73760c853b86d496a166f1 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 9 Oct 2019 04:57:55 +0900 Subject: [PATCH] Migrate CI to GitHub Actions (#422) --- .github/workflows/CI.yml | 71 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 70 --------------------------------------- Cargo.toml | 4 --- README.md | 1 - 4 files changed, 71 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..1d8b832 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,71 @@ +name: CI +on: [push, pull_request] + +jobs: + style: + name: Check Style + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update beta && rustup default beta + - name: Install Rustfmt + run: rustup component add rustfmt + - name: Check formatting + run: cargo fmt --all -- --check + + test: + name: Test + needs: [style] + runs-on: ubuntu-latest + env: + RUSTFLAGS: -Dwarnings + strategy: + matrix: + rust: + - nightly + - beta + # - stable + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} + - name: Install libssl-dev + run: sudo apt-get update && sudo apt-get install libssl-dev + - name: Build without unstable flag + run: cargo build + - name: Test examples in README + run: rustdoc --test README.md -L target/debug -L target/debug/deps + - name: Check with unstable flag + run: cargo check --features unstable + - name: Run lib tests and doc tests + run: RUST_TEST_THREADS=1 cargo test + - name: Run integration tests + run: cargo test -p h2-tests + - name: Run h2spec + # Run h2spec on nightly for the time being. + # TODO: Change it to stable after Rust 1.38 release + run: ./ci/h2spec.sh + if: matrix.rust == 'nightly' + - name: Check minimal versions + run: cargo clean; cargo update -Zminimal-versions; cargo check + if: matrix.rust == 'nightly' + + publish_docs: + name: Publish Documentation + needs: [style, test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update beta && rustup default beta + - name: Build documentation + run: cargo doc --no-deps --all-features + - name: Publish documentation + run: | + cd target/doc + git init + git add . + git -c user.name='ci' -c user.email='ci' commit -m 'Deploy H2 API documentation' + git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages + if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' && github.repository == 'hyperium/h2' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 74289b3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -language: rust -dist: trusty -sudo: false - -cache: - cargo: true - apt: true - -addons: - apt: - packages: - - libssl-dev - -matrix: - include: - - rust: nightly - - rust: beta -# - rust: stable - before_deploy: cargo doc --no-deps - allow_failures: - - rust: nightly - -before_script: - - rustup component add rustfmt - - cargo clean - -script: - # Check formatting - - cargo fmt --all -- --check - - # Build without unstable flag - - cargo build - - # Test examples in README. - - rustdoc --test README.md -L target/debug -L target/debug/deps - - # Check with unstable flag - - cargo check --features unstable - - # Run tests, this includes lib tests and doc tests - - RUST_TEST_THREADS=1 cargo test - - # Run integration tests - - cargo test -p h2-tests - - # Run h2spec on nightly for the time being. TODO: Change it to stable after Rust 1.38 release - - if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then ./ci/h2spec.sh; fi - - # Check minimal versions - - if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then cargo clean; cargo check -Z minimal-versions; fi - -deploy: - provider: pages - skip_cleanup: true - github_token: $GH_TOKEN - target_branch: gh-pages - local_dir: target/doc - on: - branch: master - repo: hyperium/h2 - rust: stable - -env: - global: - secure: LkjG3IYPu7GY7zuMdYyLtdvjR4a6elX6or1Du7LTBz4JSlQXYAaj6DxhfZfm4d1kECIlnJJ2T21BqDoJDnld5lLu6VcXQ2ZEo/2f2k77GQ/9w3erwcDtqxK02rPoslFNzSd2SCdafjGKdbcvGW2HVBEu5gYEfOdu1Cdy6Av3+vLPk5To50khBQY90Kk+cmSd7J0+CHw/wSXnVgIVoO4742+aj5pxZQLx3lsi3ZPzIh1VL4QOUlaI98ybrCVNxADQCeXRRDzj0d8NzeKlkm8eXpgpiMVRJWURMa3rU2sHU9wh+YjMyoqGZWv2LlzG5LBqde3RWPQ99ebxVhlly6RgEom8yvZbavcGJ4BA0OjviLYAMb1Wjlu1paLZikEqlvTojhpzz3PVuIBZHl+rUgnUfkuhfmMzTBJTPHPMP0GtqpIAGpyRwbv56DquuEiubl70FZmz52sXGDseoABv9jQ4SNJrDrA+bfIWkPpWwqnKaWIgGPl0n3GKeceQM3RshpaE59awYUDS4ybjtacb2Fr99fx25mTO2W4x5hcDqAvBohxRPXgRB2y0ZmrcJyCV3rfkiGFUK7H8ZBqNQ6GG/GYilgj40q6TgcnXxUxyKkykDiS9VU0QAjAwz0pkCNipJ+ImS1j0LHEOcKMKZ7OsGOuSqBmF24ewBs+XzXY7dTnM/Xc= - -notifications: - email: - on_success: never diff --git a/Cargo.toml b/Cargo.toml index d0e3920..be81bbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,10 +17,6 @@ categories = ["asynchronous", "web-programming", "network-programming"] exclude = ["fixtures/**", "ci/**"] edition = "2018" -[badges.travis-ci] -repository = "hyperium/h2" -branch = "master" - [features] # Enables `futures::Stream` implementations for various types. # This is an optional feature due to `Stream` not being stable. diff --git a/README.md b/README.md index 7b2d5f2..0d06c69 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ A Tokio aware, HTTP/2.0 client & server implementation for Rust. -[![Build Status](https://travis-ci.org/hyperium/h2.svg?branch=master)](https://travis-ci.org/hyperium/h2) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Crates.io](https://img.shields.io/crates/v/h2.svg)](https://crates.io/crates/h2) [![Documentation](https://docs.rs/h2/badge.svg)][dox]