From 8d4c17702acbb3bfb67bd9d846a3d74196f461aa Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Mon, 28 Aug 2023 02:59:14 -0700 Subject: [PATCH] Use ninja to build faster (#1755) --- .github/workflows/cmake.yml | 14 +++++++------- .github/workflows/codeql.yml | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 67b6e78dff..b294802ac6 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -76,13 +76,13 @@ jobs: - name: Install dependencies # Already installed: brotli, zlib, postgresql@14, lz4, sqlite3 - run: brew install jsoncpp mariadb hiredis redis + run: brew install ninja jsoncpp mariadb hiredis redis - name: Create Build Environment & Configure Cmake # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands run: | - cmake -B build \ + cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DBUILD_TESTING=on \ -DBUILD_SHARED_LIBS=OFF @@ -90,7 +90,7 @@ jobs: - name: Build working-directory: ./build # Execute the build. You can specify a specific target with "--target " - run: make -j $(nproc) && sudo make install + run: ninja && sudo ninja install - name: Prepare for testing run: | @@ -137,7 +137,7 @@ jobs: sudo apt update # These aren't available or don't work well in vcpkg sudo apt-get install -y libjsoncpp-dev uuid-dev libssl-dev zlib1g-dev libsqlite3-dev - sudo apt-get install -y libbrotli-dev + sudo apt-get install -y ninja-build libbrotli-dev - name: Install postgresql run: | @@ -154,7 +154,7 @@ jobs: # We'll use this as our working directory for all subsequent commands if: matrix.buildname != 'ubuntu-22.04/coroutines' run: | - cmake -B build \ + cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DBUILD_TESTING=on \ -DBUILD_SHARED_LIBS=$shared @@ -163,7 +163,7 @@ jobs: # We'll use this as our working directory for all subsequent commands if: matrix.buildname == 'ubuntu-22.04/coroutines' run: | - cmake -B build \ + cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DBUILD_TESTING=on \ -DCMAKE_CXX_FLAGS="-fcoroutines" \ @@ -172,7 +172,7 @@ jobs: - name: Build working-directory: ./build # Execute the build. You can specify a specific target with "--target " - run: make -j $(nproc) && sudo make install + run: ninja && sudo ninja install - name: Prepare for testing run: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 204cc52340..1ef15d390c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -49,13 +49,13 @@ jobs: run: | sudo apt update sudo apt-get install -y libjsoncpp-dev uuid-dev libssl-dev zlib1g-dev libsqlite3-dev - sudo apt-get install -y libbrotli-dev + sudo apt-get install -y ninja-build libbrotli-dev - name: Create Build Environment & Configure Cmake run: | - cmake -B build \ + cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ - -DBUILD_TESTING=on \ + -DBUILD_TESTING=on \ -DBUILD_SHARED_LIBS=$SHARED # Initializes the CodeQL tools for scanning. @@ -72,7 +72,7 @@ jobs: - name: Build working-directory: ./build - run: make -j $(nproc) && sudo make install + run: ninja && sudo ninja install - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2