add initial code #10
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 tool/*.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 tool/*.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 | |
deb: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Install dependency packages | |
run: sudo apt install -y libglib2.0-dev doxygen git-buildpackage debhelper cmake | |
- name: Prepare | |
run: cd src && cp -a packaging/jammy debian | |
- name: Packaging | |
run: cd src && gbp buildpackage -uc -us | |
- name: Build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: deb | |
path: ./*.deb | |
doxygen: | |
runs-on: ubuntu-latest | |
needs: [deb] | |
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 |