Build times are long this prevents builds of submodules if they are n… #181
Workflow file for this run
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: Run CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:43 | |
| steps: | |
| - name: Install system and C++ dependencies | |
| run: | | |
| dnf install -y gcc gcc-c++ clang openssl-devel wget make zlib-devel ninja-build nodejs gdb liburing-devel git xz | |
| - name: Install clang-format 22.1.1 | |
| run: | | |
| wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.1/LLVM-22.1.1-Linux-X64.tar.xz | |
| tar -xJf LLVM-22.1.1-Linux-X64.tar.xz | |
| mkdir -p /opt/llvm-22.1.1 | |
| cp -r LLVM-22.1.1-Linux-X64/* /opt/llvm-22.1.1/ | |
| echo "/opt/llvm-22.1.1/bin" >> $GITHUB_PATH | |
| - name: Install Python dependencies | |
| run: | | |
| dnf install -y python3-pip python3-virtualenv | |
| python3 -m venv /opt/venv | |
| /opt/venv/bin/pip install cmakelang PyYAML --no-cache-dir | |
| echo "/opt/venv/bin" >> $GITHUB_PATH | |
| - name: Configure git safe directory | |
| run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: false | |
| - name: Check CMake formatting | |
| run: | | |
| cmake-format --version | |
| git ls-files -- \*.cmake \*CMakeLists.txt | xargs cmake-format --check | |
| - name: Check clang formatting | |
| run: | | |
| if [ -n "${{github.event.pull_request.base.sha}}" ] | |
| then | |
| changed=$(git diff --name-only "${{github.event.pull_request.base.sha}}" HEAD | grep -E '\.(cpp|h|hpp|c)$' | while read f; do [ -f "$f" ] && echo "$f"; done || true) | |
| if [ -n "$changed" ] | |
| then | |
| if ! echo "$changed" | xargs clang-format --dry-run --Werror | |
| then | |
| echo "incorrect formatting" | |
| exit 1 | |
| fi | |
| fi | |
| fi | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:43 | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Debug | |
| preset: Debug | |
| build_dir: build_debug | |
| test_cmds: ./rpc_test && ./serialiser_test && ./json_schema_metadata_test | |
| - name: Release | |
| preset: Release | |
| build_dir: build_release | |
| test_cmds: ./rpc_test | |
| - name: Debug Coroutine | |
| preset: Debug_Coroutine | |
| build_dir: build_debug_coroutine | |
| test_cmds: ./rpc_test | |
| - name: Release Coroutine | |
| preset: Release_Coroutine_with_No_logging | |
| build_dir: build_release_coroutine | |
| test_cmds: ./rpc_test && ./serialiser_test | |
| steps: | |
| - name: Install system and C++ dependencies | |
| run: | | |
| dnf install -y gcc gcc-c++ clang openssl-devel wget make zlib-devel ninja-build nodejs gdb liburing-devel git xz | |
| - name: Install Perl dependencies | |
| run: | | |
| dnf install -y perl-core | |
| - name: Install CMake 4.2.3 | |
| run: | | |
| wget -q https://github.com/Kitware/CMake/releases/download/v4.2.3/cmake-4.2.3-linux-x86_64.tar.gz | |
| tar -zxf cmake-4.2.3-linux-x86_64.tar.gz | |
| cp -r cmake-4.2.3-linux-x86_64/* /usr/local/ | |
| - name: Configure git safe directory | |
| run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: false | |
| - name: CMake configure (${{ matrix.name }}) | |
| run: cmake -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -DGIT_SUBMODULE=ON --preset=${{ matrix.preset }} | |
| - name: Build (${{ matrix.name }}) | |
| run: cmake --build ${{ matrix.build_dir }} | |
| - name: Test (${{ matrix.name }}) | |
| working-directory: ${{ matrix.build_dir }}/output | |
| run: ${{ matrix.test_cmds }} |