aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/rust.yml
blob: 050e70d72eb8bce179d7c1c50761b43a02c6382a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Rust

on:
  push: {}
  pull_request: {}

jobs:
  build_test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
        - 1.34.0
        - 1.36.0
        - stable
        - beta
        - nightly
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: ${{ matrix.rust }}
        default: true
    - name: Build the crate on minimal version.
      uses: actions-rs/cargo@v1
      with:
        command: build
    - name: Build the crate on 1.36 with features.
      if: matrix.rust != '1.34.0'
      uses: actions-rs/cargo@v1
      with:
        command: build
        # Using `extern crate alloc` is only possible after 1.36
        args: --features=alloc,std,grab_spare_slice
    - name: Test on Stable/Beta
      if: matrix.rust != '1.34.0' && matrix.rust != '1.36.0'
      uses: actions-rs/cargo@v1
      with:
        command: test
        args: --features=alloc --features=grab_spare_slice --features=rustc_1_40
    - name: Test on Nightly with All Features
      if: matrix.rust == 'nightly'
      uses: actions-rs/cargo@v1
      with:
        command: test
        args: --all-features