wmc in the FFI (#184) #539
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: cargo fmt --all -- --check | |
- run: cargo clippy --all | |
docs: | |
name: cargo doc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc --workspace --no-deps --all-features | |
test: | |
name: test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
ffi: | |
name: ffi | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install cbindgen | |
run: cargo install cbindgen | |
- name: Generate C header file | |
run: cbindgen --config cbindgen.toml --crate rsdd --output rsdd.h | |
- name: Build (with feature flag) | |
run: cargo build --verbose --features="ffi" --release | |
- name: Move sample .c file | |
run: mv scripts/main.c main.c | |
- name: Compile sample .c file | |
run: gcc main.c -o main -lrsdd -L./target/release | |
env: | |
LD_LIBRARY_PATH: "./target/release" # necessary for dynamic linking to resolve | |
- name: Compile sample .c file | |
run: ./main | |
env: | |
LD_LIBRARY_PATH: "./target/release" # necessary for dynamic linking to resolve | |
wasm: | |
name: wasm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Build | |
run: wasm-pack build |