Skip to content

[ci] add test subdir #53

[ci] add test subdir

[ci] add test subdir #53

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install clang-tidy-14 cppcheck doxygen -y -q
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 140
- name: Download utest.h
run: |
mkdir -p test/source
curl -o test/source/utest.h https://raw.githubusercontent.com/sheredom/utest.h/master/utest.h
- name: Build and Install Headers
run: |
mkdir -p build
cd build
cmake ..
cmake --build . --config Release
sudo cmake --install . --prefix /usr/local
cd ..
- name: Build tests
run: |
cd test
mkdir -p build
cd build/
cmake ..
cd ..
cmake --build build --config Release
- name: Run Tests
run: |
cd test/build/
ctest --output-on-failure -j 2
docs:
runs-on: ubuntu-22.04
needs: test
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Install Doxygen
run: sudo apt-get install doxygen -y -q
- name: Build documentation
run: |
cmake --preset=ci-linux
cmake --build build --target docs
- name: Deploy documentation to branch
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git checkout --orphan gh-pages
git rm -rf .
cp -r build/docs/html/* .
git add .
git commit -m "Deploy docs"
git push --force origin gh-pages