[#66069] Update github CI #59
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: build library | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
workflow_call: | |
jobs: | |
build-library: | |
runs-on: ubuntu-latest | |
container: | |
image: rust:1.81-slim-bookworm | |
steps: | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install -y libclang-dev clang cmake wget ninja-build nodejs npm | |
(cd /opt && wget -q "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz" && tar xvf wasi-sdk-16.0-linux.tar.gz) | |
echo "WASI_SDK_PATH=/opt/wasi-sdk-16.0" >> "$GITHUB_ENV" | |
rustup target add wasm32-wasi | |
rustup component add rustfmt clippy | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Build | |
run: CC=${WASI_SDK_PATH}/bin/clang cargo build --target wasm32-wasi --release --features hterm | |
- name: Run C linter | |
run: cd c_lib && ${WASI_SDK_PATH}/bin/clang-tidy *.[ch] --warnings-as-errors='*' -- -I third_party | |
- name: Run C formater | |
run: | | |
cd c_lib | |
${WASI_SDK_PATH}/bin/clang-format --style='{BasedOnStyle: llvm, IndentWidth: 4}' *.[ch] --Werror --dry-run | |
- name: Run rust linter | |
run: CC=${WASI_SDK_PATH}/bin/clang cargo clippy --target wasm32-wasi | |
- name: Run rust linter with hterm feature | |
run: CC=${WASI_SDK_PATH}/bin/clang cargo clippy --target wasm32-wasi --features hterm | |
- name: Run Rust formater | |
run: cargo fmt --check |