-
Notifications
You must be signed in to change notification settings - Fork 12
89 lines (72 loc) · 2.06 KB
/
ci.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- main
paths-ignore:
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
test:
name: Check & Test
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest
- os: ubuntu-latest
env:
CARGO_BUILD_TARGET: wasm32-wasi
CARGO_TARGET_WASM32_WASI_RUNNER: /home/runner/.wasmtime/bin/wasmtime --dir=.
runs-on: ${{ matrix.os }}
env: ${{ matrix.env || fromJSON('{}') }}
steps:
- uses: actions/checkout@v3
- name: Install Wasm deps
if: matrix.env.CARGO_BUILD_TARGET == 'wasm32-wasi'
run: |
rustup target add wasm32-wasi
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk_20.0_amd64.deb
sudo dpkg --install wasi-sdk_20.0_amd64.deb
curl https://wasmtime.dev/install.sh -sSf | bash
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
save-if: ${{ github.ref_name == 'main' }}
- run: rustup show
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Clippy
run: cargo hack clippy --feature-powerset -- -D warnings
- name: Test
run: cargo hack test --feature-powerset
- name: Check Documentation
env:
RUSTDOCFLAGS: '-D warnings'
run: cargo hack doc --feature-powerset
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup show
- run: cargo fmt --all -- --check
lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
save-if: false
- run: rustup show
- run: cargo clippy -- -D warnings