From dbfef22992ae229b3cb1046fef1b083d6d278403 Mon Sep 17 00:00:00 2001 From: ChenYing Kuo Date: Fri, 29 Nov 2024 12:05:08 +0800 Subject: [PATCH] Add CI. Signed-off-by: ChenYing Kuo --- .github/workflows/ci.yaml | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..3d59483 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + paths: + - "src/**" + - "tests/**" + - "examples/**" + - "Cargo.*" + - ".github/**" + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + # To build on Ubuntu 22.04 + LLVM_CONFIG_PATH: /usr/bin/llvm-config-12 + LIBCLANG_PATH: /usr/lib/llvm-12/lib + LIBCLANG_STATIC_PATH: /usr/lib/llvm-12/lib + CLANG_PATH: /usr/bin/clang-12 + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Install clang + run: sudo apt-get install -y clang-12 libclang-12-dev + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + components: clippy + - name: Run cargo check + run: | + cargo check --all --tests + - name: Run cargo clippy + run: | + cargo clippy --version + cargo clippy --all-targets -- -W warnings -D warnings + - name: Create Documentation + run: | + cargo doc --no-deps --all-features + - name: Run doc tests + run: | + cargo test