• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1on:
2  push:
3    branches:
4      - master
5  pull_request:
6    branches:
7      - master
8      - version-0.4
9
10name: tests
11
12jobs:
13  ci:
14    runs-on: ubuntu-latest
15    strategy:
16      matrix:
17        rust:
18          - stable
19          - beta
20          - 1.57  # MSRV
21
22    steps:
23      - uses: actions/checkout@v2
24
25      - uses: actions-rs/toolchain@v1
26        name: Setup rust toolchain
27        with:
28          profile: minimal
29          toolchain: ${{ matrix.rust }}
30          override: true
31          components: rustfmt, clippy
32
33      - uses: Swatinem/rust-cache@v1
34        name: Load dependencies from cache
35
36      - uses: actions-rs/cargo@v1
37        name: Build with stable features
38        with:
39          command: build
40          args: --features stable
41
42      - uses: actions-rs/cargo@v1
43        if: ${{ matrix.rust == 'nightly' }}
44        name: Build with unstable features
45        with:
46          command: build
47          args: --all-features
48
49      - uses: actions-rs/cargo@v1
50        name: Build with minimal features
51        with:
52          command: build
53          args: --no-default-features
54
55      - uses: actions-rs/cargo@v1
56        name: Test with stable features
57        with:
58          command: test
59          args: --features stable
60
61      - uses: actions-rs/cargo@v1
62        name: Test with minimal features
63        with:
64          command: test
65          args: --no-default-features
66
67      - uses: actions-rs/cargo@v1
68        name: Check for non-standard formatting
69        if: ${{ matrix.rust == 'stable' }}
70        with:
71          command: fmt
72          args: --all -- --check
73
74      - uses: actions-rs/cargo@v1
75        name: Check for clippy hints
76        with:
77          command: clippy
78          args: -- -D warnings
79
80      - name: Test run targeting WASI
81        run: |
82          curl https://wasmtime.dev/install.sh -sSf | bash
83          source ~/.bashrc
84          export PATH=$HOME/.wasmtime/bin/:$PATH
85          cargo install cargo-wasi
86          cargo wasi bench --no-default-features -- --test
87