Buttplug sex toy control library
1name: Buttplug CI Build
2
3on:
4 push:
5 branches:
6 - dev
7 - master
8 - protocol-work**
9
10concurrency:
11 group: ${{ github.head_ref || github.ref }}
12 cancel-in-progress: true
13
14jobs:
15 build-stable:
16 runs-on: ${{ matrix.os }}
17 strategy:
18 matrix:
19 os: [ubuntu-latest, macos-latest, windows-latest]
20 steps:
21 - uses: actions/checkout@v2
22 - name: Fix ~/.cargo directory permissions
23 if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
24 run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
25 - name: Update package list
26 if: startsWith(matrix.os, 'ubuntu')
27 run: sudo apt-get -y update
28 - name: Install required packages
29 if: startsWith(matrix.os, 'ubuntu')
30 run: sudo apt-get -y install libudev-dev libusb-1.0-0-dev libdbus-1-dev
31 - name: Cache cargo registry
32 uses: actions/cache@v4
33 with:
34 path: ~/.cargo/registry
35 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
36 - name: Cache cargo build
37 uses: actions/cache@v4
38 with:
39 path: target
40 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
41 - name: Rust toolchain fetch
42 uses: actions-rs/toolchain@v1
43 with:
44 profile: minimal
45 toolchain: nightly
46 override: true
47 components: rustfmt, clippy
48 - name: Formatting check
49 continue-on-error: true
50 uses: actions-rs/cargo@v1
51 with:
52 command: fmt
53 args: --all -- --check
54 - name: Build Debug
55 run: cargo build
56 - name: Run tests
57 run: cargo test
58 # Only run doc gen on windows. It has the most code to build anyways, all other projects are a subset of it.
59 - name: Run doc gen
60 if: startsWith(matrix.os, 'windows')
61 run: cargo doc --no-deps
62# - name: Build Release
63# run: cargo build --release
64 build-wasm:
65 runs-on: ubuntu-latest
66 steps:
67 - uses: actions/checkout@v2
68 - name: Fix ~/.cargo directory permissions
69 run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
70 - name: Update package list
71 run: sudo apt-get -y update
72 - name: Install required packages
73 run: sudo apt-get -y install libudev-dev libusb-1.0-0-dev libdbus-1-dev
74 - name: Cache cargo registry
75 uses: actions/cache@v4
76 with:
77 path: ~/.cargo/registry
78 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
79 - name: Cache cargo build
80 uses: actions/cache@v4
81 with:
82 path: target
83 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.github/workflows/cache_version') }}
84 - name: Rust toolchain fetch
85 uses: actions-rs/toolchain@v1
86 with:
87 profile: minimal
88 toolchain: nightly
89 override: true
90 components: rustfmt, clippy
91 - name: WASM Toolchain fetch
92 uses: jetli/wasm-pack-action@v0.4.0
93 with:
94 version: 'latest'
95 - name: Build Dev
96 run: wasm-pack build --dev crates/buttplug_server --no-default-features --features wasm