-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
136 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Build | ||
description: Build on OSX | ||
|
||
inputs: | ||
threading: | ||
default: true | ||
extraCMakeFlags: | ||
default: "" | ||
cacheOnly: | ||
type: boolean | ||
default: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
# | ||
# Setup / Install Dependencies | ||
# | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Install Homebrew Dependencies for Intel | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
shell: bash | ||
run: | | ||
set -ex | ||
brew update-reset | ||
brew install ftgl ninja | ||
brew install antlr | ||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user aqtinstall conan==1.58.0 | ||
- name: Retrieve Qt Cache | ||
id: cache-qt | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Install Qt | ||
if: ${{ steps.cache-qt.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: | | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
aqt install-qt --outputdir ${{ runner.temp }}/qt mac desktop ${{ env.qtVersion }} | ||
# | ||
# Main Build | ||
# | ||
|
||
- name: Retrieve Conan Cache | ||
id: cache-conan | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-intel-conan-${{ env.conanHash }} | ||
path: | | ||
~/.conan | ||
~/.conancache | ||
- name: Install Conan Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
# Setup paths | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
mkdir build && cd build | ||
conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache" | ||
conan install .. --build missing -s arch=${{ env.OSX_CONAN_TARGET }} | ||
|
||
- name: Build | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
shell: bash | ||
run: | | ||
set -ex | ||
# Setup paths | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
Qt6_DIR=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/lib/cmake/Qt6 | ||
QT_BASE_DIR=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos | ||
ANTLR_EXE=/usr/local/Cellar/antlr/${{ env.antlrVersion }}/antlr-${{ env.antlrVersion }}-complete.jar | ||
echo "Detected ANTLR exe as [$ANTLR_EXE]" | ||
echo "JAVA HOME: $JAVA_HOME_21_X64" | ||
# Build | ||
cd build | ||
cmake -G Ninja -DGUI:bool=true -DMULTI_THREADING:bool=${{ inputs.threading }} -DJava_JAVA_EXECUTABLE:path=$JAVA_HOME_21_X64/bin/java -DANTLR_EXECUTABLE:string=$ANTLR_EXE -DCMAKE_OSX_ARCHITECTURES:string="${{ env.OSX_CMAKE_TARGET }}" ${{ inputs.extraCMakeFlags }} -DQT_BASE_DIR=$QT_BASE_DIR ../ | ||
cmake --build . --config Release | ||
cd ../ | ||
# Deploy Conan dependencies for ease | ||
mkdir deploy && cd deploy | ||
conan install .. -g deploy -s arch=${{ env.OSX_CONAN_TARGET }} | ||
- name: Upload Raw Build Artifacts | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: osx-build-artifacts | ||
path: | | ||
${{ github.workspace }}/build | ||
${{ github.workspace }}/deploy | ||
retention-days: 1 |
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
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
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