Skip to content

Update manual build instructions #599

Update manual build instructions

Update manual build instructions #599

Workflow file for this run

name: CMake
env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: "${{ matrix.configurations.name }} | ${{ matrix.configurations.config-preset }} | ${{ matrix.cmake-build-type }}"
runs-on: ${{ matrix.configurations.os }}
strategy:
fail-fast: false
matrix:
configurations:
- name: Ubuntu 20.04
os: ubuntu-20.04
config-preset: linux-clang
build-preset: linux-clang-build
test-preset: linux-clang-test
- name: Ubuntu 20.04
os: ubuntu-20.04
config-preset: linux-gcc
build-preset: linux-gcc-build
test-preset: linux-gcc-test
- name: Ubuntu 20.04
os: ubuntu-20.04
config-preset: linux-gcc-11
build-preset: linux-gcc-build-11
test-preset: linux-gcc-test-11
- name: Ubuntu 22.04
os: ubuntu-22.04
config-preset: linux-clang
build-preset: linux-clang-build
test-preset: linux-clang-test
- name: Ubuntu 22.04
os: ubuntu-22.04
config-preset: linux-gcc
build-preset: linux-gcc-build
test-preset: linux-gcc-test
- name: Ubuntu 22.04
os: ubuntu-22.04
config-preset: linux-gcc-11
build-preset: linux-gcc-build-11
test-preset: linux-gcc-test-11
- name: Windows 2019
os: windows-2019
config-preset: x64-windows-2019
build-preset: x64-windows-2019-build
test-preset: x64-windows-2019-test
- name: Windows 2022
os: windows-2022
config-preset: x64-windows
build-preset: x64-windows-build
test-preset: x64-windows-test
- name: MacOS 11
os: macos-11
config-preset: osx
build-preset: osx-build
test-preset: osx-test
- name: MacOS 12
os: macos-12
config-preset: osx
build-preset: osx-build
test-preset: osx-test
cmake-build-type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- uses: turtlesec-no/[email protected]
# Workaround for https://github.com/actions/runner-images/issues/8659
- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8
with:
os: ${{ matrix.configurations.os }}
# Workaround for https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
if: (matrix.configurations.os == 'ubuntu-22.04') && (matrix.cmake-build-type == 'Debug')
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Create vcpkg build folder
env:
vcpkg_project_root: ${{runner.workspace}}/ms-pacman/build/${{ matrix.configurations.config-preset }}
run: |
mkdir -p ${{ env.vcpkg_project_root }}/vcpkg_installed
mkdir -p ${{ env.vcpkg_project_root }}/_deps
- name: Cache vcpkg
uses: actions/cache@v4
env:
vcpkg_project_root: ${{runner.workspace}}/ms-pacman/build/${{ matrix.configurations.config-preset }}
cache-name: vcpkg-modules
with:
path: |
/home/runner/.cache/vcpkg
${{ env.vcpkg_project_root }}/vcpkg_installed
${{ env.vcpkg_project_root }}/_deps
key: ${{ matrix.configurations.os }}-${{ matrix.configurations.config-preset }}-${{ matrix.cmake-build-type }}-${{ hashFiles('vcpkg.json') }}-${{ hashFiles('cmake/vcpkg.cmake') }}-ranges
- name: Install Linux dependencies
if: startsWith( matrix.configurations.os, 'ubuntu-' )
run: sudo apt-get update && sudo apt-get install -y libx11-dev libxcursor-dev libxi-dev libxrandr-dev libgl1-mesa-dev libudev-dev clang-12 make ninja-build cmake autoconf libtool mesa-common-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev
- name: Install Additional Linux dependencies
if: matrix.configurations.config-preset == 'linux-gcc-11'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update && sudo apt-get install -y g++-11
- name: Configure CMake
shell: bash
run: cmake --preset ${{ matrix.configurations.config-preset }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }}
- name: Build
shell: bash
run: cmake --build --preset ${{ matrix.configurations.build-preset }} --config ${{ matrix.cmake-build-type }}
- name: Test
shell: bash
run: ctest --preset ${{ matrix.configurations.test-preset }} -C ${{ matrix.cmake-build-type }} --extra-verbose