Skip to content

Commit

Permalink
gha: speedup compilation with ninja.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Dec 8, 2023
1 parent 61a16bc commit 2fff6e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
with:
submodules: recursive

Expand Down Expand Up @@ -52,13 +53,13 @@ jobs:
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
schroot --chroot steamrt_scout_i386 -- cmake -G "Ninja" -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
- name: Build on Linux with vgui
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui"
schroot --chroot steamrt_scout_i386 -- cmake -G "Ninja" -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui"
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install
Expand All @@ -69,12 +70,12 @@ jobs:
- name: Build on Windows
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist"
cmake -G "Ninja" -B build -DCMAKE_INSTALL_PREFIX="dist"
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
- name: Build on Windows with vgui
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui"
cmake -G "Ninja" -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui"
msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj
- name: Extract branch name
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
with:
submodules: recursive

Expand Down Expand Up @@ -67,7 +68,7 @@ jobs:
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
schroot --chroot steamrt_scout_i386 -- cmake -G "Ninja" -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
Expand All @@ -77,7 +78,7 @@ jobs:
- name: Build on Windows
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
cmake -G "Ninja" -B build -DCMAKE_INSTALL_PREFIX="dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
msbuild -verbosity:normal /property:Configuration=${{ github.event.inputs.buildtype }} build/INSTALL.vcxproj
- name: Extract branch name
Expand Down

0 comments on commit 2fff6e3

Please sign in to comment.