Migrate CI to GitHub Actions (#422)
This commit is contained in:
committed by
Sean McArthur
parent
86e53054a6
commit
37b66e8981
71
.github/workflows/CI.yml
vendored
Normal file
71
.github/workflows/CI.yml
vendored
Normal file
@@ -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'
|
||||
70
.travis.yml
70
.travis.yml
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
A Tokio aware, HTTP/2.0 client & server implementation for Rust.
|
||||
|
||||
[](https://travis-ci.org/hyperium/h2)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://crates.io/crates/h2)
|
||||
[][dox]
|
||||
|
||||
Reference in New Issue
Block a user