aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/lint.yml
blob: 4c33e17766a346bbec3350fce96c415850e20785 (plain) (blame)
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
48
49
50
51
52
53
54
55
56
---
on: push
name: Test & Lint
permissions:
  contents: read

# Make sure CI fails on all warnings, including Clippy lints
env:
  RUSTFLAGS: "-Dwarnings"

jobs:
  clippy_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4

      - name: Install WASI SDK
        run: |
          wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz
          tar -xzf wasi-sdk-20.0-linux.tar.gz
          mv wasi-sdk-20.0 /opt/wasi-sdk
        env:
          WASI_SDK_PATH: /opt/wasi-sdk

      - name: Install Rust
        uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable
        with:
          toolchain: "1.95.0"
          target: wasm32-wasip1
          components: clippy

      - name: Run Clippy
        uses: clechasseur/rs-clippy-check@62ad100473a5e6513e86407b859091115ec89ae3 # v3
        with:
          args: --all-features --lib
          toolchain: "1.95.0"

  tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
      - uses: jcbhmr/setup-wasmtime@960c367a99921eb0b02f5778fce9ae8f110bf0f0 # v2

      - name: Install Rust
        uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable
        with:
          toolchain: "1.95.0"
          target: wasm32-wasip1
        env:
          WASI_SDK_PATH: /opt/wasi-sdk

      - name: Install cargo wasi
        run: cargo install --locked cargo-nextest

      - name: Run tests
        run: cargo nextest run --lib