add initial code #4
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: | |
- master | |
pull_request: | |
jobs: | |
clang_format_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Install clang-format | |
run: sudo apt install -y clang-format | |
- name: lint | |
run: | | |
clang-format --dry-run --Werror \ | |
src/*.c sample/*.c tests/*.c \ | |
include/*.h | |
clang_tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Install clang-tidy | |
run: sudo apt install -y clang-tidy libglib2.0-dev | |
- name: Configure | |
run: cmake -DCMAKE_INSTALL_PREFIX=/usr -S . -B build_x86 | |
- name: clang-tidy | |
run: clang-tidy -p build_x86 src/*.c sample/*.c tests/*.c | |
build: | |
runs-on: ubuntu-latest | |
needs: [clang_format_lint, clang_tidy] | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Install dependency libraries | |
run: sudo apt install -y libglib2.0-dev | |
- name: Configure | |
run: cmake -DCMAKE_INSTALL_PREFIX=/usr -S . -B build | |
- name: Build | |
run: cmake --build build --parallel -v | |
- name: Test | |
run: cd build && make test | |
- name: Install | |
run: DESTDIR=out cmake --install build | |
- name: Build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: files | |
path: out | |
doxygen: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Install doxygen | |
run: sudo apt-get install doxygen graphviz | |
- name: Generate doxygen | |
run: doxygen | |
- name: Deploy to Github Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: doc/html | |
clean: true |