Skip to content

Drop some unused code #3323

Drop some unused code

Drop some unused code #3323

Workflow file for this run

name: MacOS
on:
pull_request: null
workflow_dispatch:
inputs:
myCommit:
description: Commit SHA1
required: false
default: ''
type: string
releaseTag:
description: Release tag
required: false
default: ''
type: string
workflow_call:
inputs:
myCommit:
description: Commit SHA1
required: false
default: ''
type: string
releaseTag:
description: Release tag
required: false
default: ''
type: string
push: null
release:
types:
- published
jobs:
build_macos:
runs-on: macos-14
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
configuration:
- Debug
- RelWithDebInfo
architecture:
- x86_64
- arm64
steps:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4
- name: Checkout
uses: actions/checkout@v4.2.2
with:
submodules: recursive
ref: '${{inputs.myCommit}}'
- name: Restore data cache
id: restore-data-cache
uses: actions/cache/restore@v3
with:
path: |
OpenEnroth_GameData
key: data-cache
- name: Run ccache
uses: hendrikmuhs/ccache-action@v1.2.14
with:
key: 'macos-${{matrix.configuration}}-${{matrix.architecture}}'
save: ${{ github.ref == 'refs/heads/master' || inputs.releaseTag != '' }}
verbose: 2
max-size: 200M
# MacOS deployment target here should be kept in sync with what's set in OpenEnroth_Dependencies:
# https://github.com/OpenEnroth/OpenEnroth_Dependencies/blob/master/scripts/build_all.sh
- name: Configure
run: |
if [ "${{matrix.architecture}}" = "x86_64" ]; then
export MACOSX_DEPLOYMENT_TARGET="10.15"
fi
if [ "${{matrix.architecture}}" = "arm64" ]; then
export MACOSX_DEPLOYMENT_TARGET="11"
fi
cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{matrix.configuration}} -DCMAKE_OSX_ARCHITECTURES=${{matrix.architecture}}
- name: Build
working-directory: build
run: |
make -j4
- name: Run unit tests
working-directory: build
run: |
make Run_UnitTest
- name: Run game tests
if: steps.restore-data-cache.outputs.cache-hit == 'true'
working-directory: build
run: |
make Run_GameTest_Headless_Parallel
env:
OPENENROTH_MM7_PATH: /Users/runner/work/OpenEnroth/OpenEnroth/OpenEnroth_GameData/mm7
- name: Run retrace tests
if: steps.restore-data-cache.outputs.cache-hit == 'true' && matrix.configuration != 'Debug'
working-directory: build
run: |
make Run_RetraceTest_Headless_Parallel
env:
OPENENROTH_MM7_PATH: /Users/runner/work/OpenEnroth/OpenEnroth/OpenEnroth_GameData/mm7
- name: Prepare files for release
run: |
mkdir dist
cp -r build/src/Bin/OpenEnroth/OpenEnroth.app dist/
hdiutil create OpenEnroth.dmg -ov -volname "OpenEnroth" -fs HFS+ -srcfolder dist
- name: Zip folder for release
if: inputs.releaseTag != ''
uses: thedoctor0/zip-release@0.7.1
with:
type: zip
filename: ${{runner.os}}_${{inputs.releaseTag}}_${{matrix.configuration}}_${{matrix.architecture}}.zip
path: dist
- name: Publish release
if: inputs.releaseTag != ''
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: '${{inputs.releaseTag}}'
files: |
${{runner.os}}_${{inputs.releaseTag}}_${{matrix.configuration}}_${{matrix.architecture}}.zip
- name: Check dependencies
run: |
otool -L build/src/Bin/OpenEnroth/OpenEnroth.app/Contents/MacOS/OpenEnroth
- name: Cleanup ccache
run: |
ccache -c