72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
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'
|