Compile macOS Intel Version on Apple Silicon #1990
Workflow file for this run
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: Descent 3 Build | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '**/*.md' | ||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '**/README.md' | ||
- '**/LICENSE' | ||
jobs: | ||
build: | ||
name: ${{ matrix.os.name }}, ${{ matrix.build_type }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- runner: windows-latest | ||
preset: win | ||
cc: cl | ||
cxx: cl | ||
name: Windows-x64 | ||
shell: '' | ||
- runner: macos-14 | ||
preset: mac | ||
cc: cc | ||
cxx: c++ | ||
name: macOS-Intel | ||
shell: arch -x86_64 /bin/bash -e {0} | ||
- runner: macos-14 | ||
preset: mac | ||
cc: cc | ||
cxx: c++ | ||
name: macOS-ARM | ||
shell: '' | ||
- runner: ubuntu-latest | ||
preset: linux | ||
cc: gcc | ||
cxx: g++ | ||
name: Linux-x64 | ||
shell: '' | ||
- runner: ubuntu-latest | ||
preset: linux | ||
cc: clang | ||
cxx: clang++ | ||
name: Linux-x64-clang | ||
shell: '' | ||
- runner: ubuntu-latest | ||
preset: linux-cross-arm64 | ||
cc: gcc | ||
cxx: g++++ | ||
name: Linux-cross-arm64 | ||
shell: '' | ||
build_type: | ||
- Debug | ||
- Release | ||
runs-on: ${{ matrix.os.runner }} | ||
# env: | ||
# MACOS_ARCH_COMMAND: '' # default to nothing | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install macOS Rosetta 2 | ||
if: ${{ matrix.os.name == 'macOS-Intel' }} | ||
run: | | ||
/usr/sbin/softwareupdate --install-rosetta --agree-to-license | ||
# echo "MACOS_ARCH_COMMAND=arch -x86_64" >> $GITHUB_ENV | ||
- name: Install Intel version of Brew | ||
if: ${{ matrix.os.name == 'macOS-Intel' }} | ||
shell: ${{ matrix.os.shell }} | ||
Check failure on line 79 in .github/workflows/build.yml GitHub Actions / Descent 3 BuildInvalid workflow file
|
||
run: | | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
- name: Install macOS ARM dependencies | ||
if: ${{ matrix.os.preset == 'mac' && matrix.os.name == 'macOS-ARM' }} | ||
run: brew bundle install | ||
- name: Install macOS Intel dependencies | ||
if: ${{ matrix.os.preset == 'mac' && matrix.os.name == 'macOS-Intel' }} | ||
shell: ${{ matrix.os.shell }} | ||
run: | | ||
eval "$(/usr/local/bin/brew shellenv)" | ||
echo "PATH=$PATH" >> $GITHUB_ENV # modify $PATH for future steps so the Intel Brew and its installs are enshrined as the default | ||
brew bundle install | ||
- name: Install Linux dependencies | ||
if: ${{ matrix.os.runner == 'ubuntu-latest' }} | ||
run: | | ||
sudo apt update | ||
sudo apt install -y --no-install-recommends \ | ||
ninja-build cmake g++ curl pkg-config autoconf automake libtool libltdl-dev make python3-jinja2 libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev | ||
- name: Install Linux Cross-compilation dependencies | ||
if: ${{ matrix.os.preset == 'linux-cross-arm64' }} | ||
run: | | ||
sudo apt install -y --no-install-recommends \ | ||
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu | ||
- name: Install Windows dependencies | ||
if: ${{ matrix.os.runner == 'windows-latest' }} | ||
run: choco install ninja | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
if: ${{ matrix.os.runner == 'windows-latest' }} | ||
with: | ||
arch: win64 | ||
- uses: lukka/run-vcpkg@v11 | ||
with: | ||
vcpkgJsonGlob: vcpkg.json | ||
- name: Configure cross-compiled build | ||
if: ${{ matrix.os.preset == 'linux-cross-arm64' }} | ||
run: | | ||
cmake --preset linux | ||
ninja -f build-${{ matrix.build_type }}.ninja -C builds/linux/ HogMaker | ||
cmake --preset linux-cross-arm64 -DHogMaker_DIR=$PWD/builds/linux/ -DBUILD_TESTING=OFF -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=OFF -DUSE_EXTERNAL_PLOG=ON | ||
- name: Configure CMake | ||
if: ${{ matrix.os.preset != 'linux-cross-arm64' }} | ||
shell: ${{ matrix.os.shell }} | ||
env: | ||
CC: ${{ matrix.os.cc }} | ||
CXX: ${{ matrix.os.cxx }} | ||
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON -DUSE_EXTERNAL_PLOG=ON | ||
- name: Build ${{ matrix.build_type }} | ||
shell: ${{ matrix.os.shell }} | ||
run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose | ||
- name: Run ${{ matrix.build_type }} Unittests | ||
if: ${{ matrix.os.preset != 'linux-cross-arm64' }} | ||
shell: ${{ matrix.os.shell }} | ||
run: ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }} | ||
- name: Local install | ||
shell: ${{ matrix.os.shell }} | ||
# There no cmake install presets so install in traditional way | ||
run: cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }} | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Descent3_${{ matrix.build_type }}_${{ matrix.os.name }} | ||
path: ${{ github.workspace }}/builds/${{ matrix.os.preset }}/installed/ |