Macos #674
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: x64 | |
full_arch: x86_64 | |
name: Mac OS (${{ matrix.arch }}) | |
runs-on: macos-latest | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup vcpkg caching | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite') | |
- name: Install OpenGFX | |
run: | | |
mkdir -p ~/Documents/OpenTTD/baseset | |
cd ~/Documents/OpenTTD/baseset | |
echo "::group::Download OpenGFX" | |
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip | |
echo "::endgroup::" | |
echo "::group::Unpack OpenGFX" | |
unzip opengfx-all.zip | |
echo "::endgroup::" | |
rm -f opengfx-all.zip | |
- name: Install GCC problem matcher | |
uses: ammaraskar/gcc-problem-matcher@master | |
- name: Build | |
run: | | |
mkdir build | |
cd build | |
echo "::group::CMake" | |
cmake .. \ | |
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \ | |
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \ | |
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \ | |
# EOF | |
echo "::endgroup::" | |
echo "::group::Build" | |
echo "Running on $(sysctl -n hw.logicalcpu) cores" | |
cmake --build . -j $(sysctl -n hw.logicalcpu) | |
echo "::endgroup::" | |
- name: Test | |
run: | | |
cd build | |
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120 | |
check_annotations: | |
name: Check Annotations | |
needs: | |
- macos | |
if: always() && github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check annotations | |
uses: OpenTTD/actions/annotation-check@v3 |