1
1
name : CI
2
- on : [push, pull_request]
2
+ on :
3
+ pull_request :
4
+ push :
5
+ branches :
6
+ - master
7
+ env :
8
+ RUST_BACKTRACE : 1
3
9
4
10
jobs :
5
11
style :
6
12
name : Check Style
7
13
runs-on : ubuntu-latest
8
14
steps :
9
- - uses : actions/checkout@master
10
- - name : Install Rust
11
- run : rustup update beta && rustup default beta
12
- - name : Install Rustfmt
13
- run : rustup component add rustfmt
14
- - name : Check formatting
15
- run : cargo fmt --all -- --check
15
+ - name : Checkout
16
+ uses : actions/checkout@v1
17
+
18
+ - name : Install Rust
19
+ uses : actions-rs/toolchain@v1
20
+ with :
21
+ profile : minimal
22
+ toolchain : stable
23
+ override : true
24
+ components : rustfmt
25
+
26
+ - name : cargo fmt --check
27
+ uses : actions-rs/cargo@v1
28
+ with :
29
+ command : fmt
30
+ args : --all -- --check
16
31
17
32
test :
18
33
name : Test
@@ -25,47 +40,46 @@ jobs:
25
40
rust :
26
41
- nightly
27
42
- beta
28
- # - stable
43
+ - stable
29
44
steps :
30
- - uses : actions/checkout@master
31
- - name : Install Rust
32
- run : rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
45
+ - name : Checkout
46
+ uses : actions/checkout@v1
47
+
48
+ - name : Install Rust (${{ matrix.rust }})
49
+ uses : actions-rs/toolchain@v1
50
+ with :
51
+ profile : minimal
52
+ toolchain : ${{ matrix.rust }}
53
+ override : true
54
+
33
55
- name : Install libssl-dev
34
56
run : sudo apt-get update && sudo apt-get install libssl-dev
35
57
- name : Build without unstable flag
36
- run : cargo build
37
- - name : Test examples in README
38
- run : rustdoc --test README.md -L target/debug -L target/debug/deps
58
+ uses : actions-rs/cargo@v1
59
+ with :
60
+ command : build
61
+
39
62
- name : Check with unstable flag
40
- run : cargo check --features unstable
63
+ uses : actions-rs/cargo@v1
64
+ with :
65
+ command : check
66
+ args : --features unstable
67
+
41
68
- name : Run lib tests and doc tests
42
- run : RUST_TEST_THREADS=1 cargo test
69
+ uses : actions-rs/cargo@v1
70
+ with :
71
+ command : test
72
+
43
73
- name : Run integration tests
44
- run : cargo test -p h2-tests
74
+ uses : actions-rs/cargo@v1
75
+ with :
76
+ command : test
77
+ args : -p h2-tests
78
+
45
79
- name : Run h2spec
46
- # Run h2spec on nightly for the time being.
47
- # TODO: Change it to stable after Rust 1.38 release
48
80
run : ./ci/h2spec.sh
49
- if : matrix.rust == 'nightly'
81
+ if : matrix.rust == 'stable'
82
+
50
83
- name : Check minimal versions
51
84
run : cargo clean; cargo update -Zminimal-versions; cargo check
52
85
if : matrix.rust == 'nightly'
53
-
54
- publish_docs :
55
- name : Publish Documentation
56
- needs : [style, test]
57
- runs-on : ubuntu-latest
58
- steps :
59
- - uses : actions/checkout@master
60
- - name : Install Rust
61
- run : rustup update beta && rustup default beta
62
- - name : Build documentation
63
- run : cargo doc --no-deps --all-features
64
- - name : Publish documentation
65
- run : |
66
- cd target/doc
67
- git init
68
- git add .
69
- git -c user.name='ci' -c user.email='ci' commit -m 'Deploy H2 API documentation'
70
- git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
71
- if : github.event_name == 'push' && github.event.ref == 'refs/heads/master' && github.repository == 'hyperium/h2'
0 commit comments