feat: add unit tests in ci #223
This file contains hidden or 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: Validate Project | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
BUILD_TYPE: Debug | |
jobs: | |
build: | |
strategy: | |
matrix: | |
arch: [ubuntu-24.04, ubuntu-24.04-arm] | |
runs-on: ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: sudo apt-get update && sudo apt-get install -y clang-tidy libcurl4-openssl-dev | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_CLANG_TIDY=clang-tidy -DENABLE_TESTS=ON | |
- name: Build It | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test It | |
run: cd build && make && ctest | |
build-demo: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: sudo apt-get update && sudo apt-get install -y clang-tidy libcurl4-openssl-dev | |
- name: Build and install lambda runtime | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/lambda-install | |
make | |
make install | |
- name: Build and package demo project | |
run: | | |
cd examples/demo | |
mkdir build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/lambda-install | |
make | |
make aws-lambda-package-demo | |
format: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check Formatting | |
run: ./ci/codebuild/format-check.sh |