• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on: [push, pull_request]
4
5env:
6  RUST_MINVERSION: 1.41.1
7  CARGO_INCREMENTAL: 0
8  CARGO_NET_RETRY: 10
9
10jobs:
11  test:
12    name: Test
13    runs-on: ubuntu-latest
14
15    strategy:
16      matrix:
17        rust:
18          - stable
19          - beta
20          - nightly
21          - 1.48.0
22
23        features:
24          - ''
25
26        include:
27          - rust: stable
28            features: ''
29          - rust: stable
30            features: '--features "std"'
31          - rust: stable
32            features: '--no-default-features'
33          - rust: stable
34            features: '--no-default-features --features "alloc"'
35          - rust: nightly
36            features: ''
37          - rust: nightly
38            features: '--no-default-features'
39          - rust: nightly
40            features: '--no-default-features --features "alloc"'
41
42    steps:
43      - name: Checkout sources
44        uses: actions/checkout@v2
45
46      - name: Install rust (${{ matrix.rust }})
47        uses: actions-rs/toolchain@v1
48        with:
49          toolchain: ${{ matrix.rust }}
50          profile: minimal
51          override: true
52
53      - name: Cache
54        uses: Swatinem/rust-cache@v1
55
56      - name: Build
57        uses: actions-rs/cargo@v1
58        with:
59          command: build
60          args: --verbose ${{ matrix.features }}
61
62      - name: Test
63        uses: actions-rs/cargo@v1
64        with:
65          command: test
66          args: --verbose ${{ matrix.features }}
67
68  minrust:
69    name: Test minimal rust version
70    runs-on: ubuntu-latest
71
72    steps:
73      - name: Checkout sources
74        uses: actions/checkout@v2
75
76      - name: Install rust (${{ env.RUST_MINVERSION }})
77        uses: actions-rs/toolchain@v1
78        with:
79          toolchain: ${{ env.RUST_MINVERSION }}
80          profile: minimal
81          override: true
82
83      - name: Cache
84        uses: Swatinem/rust-cache@v1
85
86      - name: Build
87        uses: actions-rs/cargo@v1
88        with:
89          command: build
90          args: --verbose --no-default-features --features "alloc,std"
91
92  bench:
93    name: Bench
94    runs-on: ubuntu-latest
95
96    steps:
97      - name: Checkout sources
98        uses: actions/checkout@v2
99
100      - name: Install rust
101        uses: actions-rs/toolchain@v1
102        with:
103          toolchain: nightly
104          profile: minimal
105          override: true
106
107      - name: Cache
108        uses: Swatinem/rust-cache@v1
109
110      - name: Compile bench
111        uses: actions-rs/cargo@v1
112        with:
113          command: bench
114          args: --verbose --no-run --features ""
115
116      - name: Run bench
117        uses: actions-rs/cargo@v1
118        with:
119          command: bench
120          args: --verbose --features ""
121
122  doc:
123    name: Build documentation
124    runs-on: ubuntu-latest
125
126    steps:
127      - name: Checkout sources
128        uses: actions/checkout@v2
129
130      - name: Install rust
131        uses: actions-rs/toolchain@v1
132        with:
133          toolchain: nightly
134          profile: minimal
135          override: true
136
137      - name: Build
138        env:
139          RUSTDOCFLAGS: -D warnings
140        run: cargo doc --no-deps --document-private-items --workspace --verbose --features "std docsrs"
141
142  fmt:
143    name: Check formatting
144    runs-on: ubuntu-latest
145
146    steps:
147      - name: Checkout sources
148        uses: actions/checkout@v2
149
150      - name: Install rust
151        uses: actions-rs/toolchain@v1
152        with:
153          toolchain: stable
154          components: rustfmt
155          profile: minimal
156          override: true
157
158      - name: cargo fmt -- --check
159        continue-on-error: true
160        uses: actions-rs/cargo@v1
161        with:
162          command: fmt
163          args: -- --check
164
165  coverage:
166    name: Coverage
167    runs-on: ubuntu-latest
168
169    steps:
170      - name: Checkout sources
171        uses: actions/checkout@v2
172
173      - name: Install rust
174        uses: actions-rs/toolchain@v1
175        with:
176          toolchain: stable
177          profile: minimal
178          override: true
179
180      - name: Cache
181        uses: Swatinem/rust-cache@v1
182
183      - name: Install cargo-tarpaulin
184        uses: actions-rs/cargo@v1
185        with:
186          command: install
187          args: cargo-tarpaulin
188
189      - name: Run cargo tarpaulin
190        uses: actions-rs/cargo@v1
191        with:
192          command: tarpaulin
193          args: --output-dir coverage --out Lcov
194
195      - name: Publish to Coveralls
196        uses: coverallsapp/github-action@master
197        with:
198          github-token: ${{ secrets.GITHUB_TOKEN }}
199