Merge branch 'main' into sshirokov/capnp #32
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: Test Workflow | |
on: [push, pull_request] | |
env: | |
LLVM_VERSION: 18 | |
jobs: | |
debug: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: ['clang', 'gcc'] | |
include: | |
- toolchain: gcc | |
c-compiler: gcc | |
cxx-compiler: g++ | |
- toolchain: clang | |
c-compiler: clang | |
cxx-compiler: clang++ | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh $LLVM_VERSION | |
sudo apt update -y && sudo apt upgrade -y | |
sudo apt-get -y install gcc-multilib g++-multilib clang-tidy-$LLVM_VERSION | |
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VERSION 50 | |
clang-tidy --version | |
# Install Cap'n Proto | |
curl -O https://capnproto.org/capnproto-c++-1.0.2.tar.gz | |
tar zxf capnproto-c++-1.0.2.tar.gz | |
cd capnproto-c++-1.0.2 | |
./configure | |
make -j6 check | |
sudo make install | |
- run: > | |
cmake | |
-B ${{ github.workspace }}/build | |
-DCMAKE_BUILD_TYPE=Debug | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} | |
- working-directory: ${{github.workspace}}/build | |
run: | | |
make VERBOSE=1 | |
make test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{github.job}}_${{matrix.toolchain}} | |
path: ${{github.workspace}}/**/* | |
retention-days: 2 | |
optimizations: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: ['clang', 'gcc'] | |
build_type: [Release, MinSizeRel] | |
include: | |
- toolchain: gcc | |
c-compiler: gcc | |
cxx-compiler: g++ | |
- toolchain: clang | |
c-compiler: clang | |
cxx-compiler: clang++ | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
sudo apt update -y && sudo apt upgrade -y | |
sudo apt install gcc-multilib g++-multilib | |
# Install Cap'n Proto | |
curl -O https://capnproto.org/capnproto-c++-1.0.2.tar.gz | |
tar zxf capnproto-c++-1.0.2.tar.gz | |
cd capnproto-c++-1.0.2 | |
./configure | |
make -j6 check | |
sudo make install | |
- run: > | |
cmake | |
-B ${{ github.workspace }}/build | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} | |
-DNO_STATIC_ANALYSIS=1 | |
- working-directory: ${{github.workspace}}/build | |
run: | | |
make VERBOSE=1 | |
make test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{github.job}}_${{matrix.toolchain}}_${{matrix.build_type}} | |
path: ${{github.workspace}}/**/* | |
retention-days: 2 | |
style_check: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DoozyX/[email protected] | |
with: | |
source: './test ./src' | |
extensions: 'c,h,cpp,hpp' | |
clangFormatVersion: ${{ env.LLVM_VERSION }} |