Skip to content

Commit

Permalink
Conan Deps (#1785)
Browse files Browse the repository at this point in the history
Co-authored-by: Noella Spitz <101950441+rhinoella@users.noreply.github.com>
  • Loading branch information
trisyoungs and rhinoella committed Feb 12, 2024
1 parent 8dfb71c commit d1ae12b
Show file tree
Hide file tree
Showing 39 changed files with 245 additions and 855 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: "./.github/workflows/setup"
- name: Install Prerequisites
Expand All @@ -36,19 +36,13 @@ jobs:
- name: Build
run: |
set -ex
mkdir build
cd build
conan install ../ -s compiler.libcxx=libstdc++11
mkdir build && cd build
cmake ../ -G "Ninja" -DBUILD_BENCHMARKS:bool=true -DANTLR_EXECUTABLE:path=`pwd`/../antlr4.jar
ninja
- name: Deploy Dependencies
run: |
mkdir deploy && cd deploy
conan install .. -g deploy -s compiler.libcxx=libstdc++11
- name: Run benchmarks
run: |
set -ex
export LD_LIBRARY_PATH=`pwd`/deploy/onetbb/lib
export LD_LIBRARY_PATH=`pwd`/build/onetbb/lib
./build/bin/benchmarks --benchmark_format=json | tee benchmark_result.json
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ runs:
target: ${{ inputs.target }}
cacheOnly: ${{ inputs.cacheOnly }}

- name: Build (OSX) Intel
if: runner.os == 'MacOS' && env.OSX_CMAKE_TARGET == 'x86_64'
uses: "./.github/workflows/build/osx-intel"
with:
cacheOnly: ${{ inputs.cacheOnly }}

- name: Build (OSX) Silicon
if: runner.os == 'MacOS' && env.OSX_CMAKE_TARGET == 'arm64'
uses: "./.github/workflows/build/osx-silicon"
- name: Build (OSX)
if: runner.os == 'MacOS'
uses: "./.github/workflows/build/osx"
with:
cacheOnly: ${{ inputs.cacheOnly }}

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build/linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build
description: Build on Linux via nix

inputs:
extraCMakeFlags:
default: ""
target:
default: "dissolve"
cacheOnly:
Expand All @@ -29,7 +27,7 @@ runs:
target: ${{ inputs.target }}

- name: Cache Nix Store
uses: actions/cache@v3
uses: actions/cache@v4
id: nix-cache
with:
path: /tmp/nixcache
Expand Down
132 changes: 0 additions & 132 deletions .github/workflows/build/osx-silicon/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ description: Build on OSX
inputs:
threading:
default: true
extraCMakeFlags:
default: ""
cacheOnly:
type: boolean
default: false
Expand All @@ -18,12 +16,7 @@ runs:
# Setup / Install Dependencies
#

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}

- name: Install Homebrew Dependencies for Intel
- name: Install Homebrew Dependencies
if: ${{ inputs.cacheOnly == 'false' }}
shell: bash
run: |
Expand All @@ -36,11 +29,11 @@ runs:
- name: Install Python Dependencies
shell: bash
run: |
pip3 install --user aqtinstall conan==1.58.0
pip3 install --user aqtinstall conan==1.*
- name: Retrieve Qt Cache
id: cache-qt
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: osx-qt-${{ env.qtVersion }}
path: ${{ runner.temp }}/qt
Expand All @@ -58,27 +51,13 @@ runs:

- name: Retrieve Conan Cache
id: cache-conan
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: osx-intel-conan-${{ env.conanHash }}
key: osx-${{ runner.arch }}-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
Expand All @@ -89,26 +68,41 @@ runs:
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
# Find ANTLR4
brew --prefix antlr
ANTLR_EXE=$(brew --prefix antlr)/antlr-${{ env.antlrVersion }}-complete.jar
echo "Detected ANTLR exe as [$ANTLR_EXE]"
echo "JAVA HOME: $JAVA_HOME_21_X64"
# Make sure we have a Java binary path - $JAVA_HOME_21_X64 does not appear to work on Silicon
if [ "${JAVA_HOME_21_X64}" == "" ]
then
JAVA_RUNTIME=`which java`
else
JAVA_RUNTIME=${JAVA_HOME_21_X64}/bin/java
fi
echo "Java Runtime Executable: ${JAVA_RUNTIME}"
# Set conan cache location
conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache"
# Set minimum deployment target version
export MACOSX_DEPLOYMENT_TARGET=10.15
# 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 ../
mkdir build && cd build
cmake -G Ninja -DGUI:bool=true -DMULTI_THREADING:bool=${{ inputs.threading }} -DJava_JAVA_EXECUTABLE:path=${JAVA_RUNTIME} -DANTLR_EXECUTABLE:string=$ANTLR_EXE -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 }}
# Copy over ftgl libs so we can ship them with the bundle
mkdir ftgl
cp -v $(brew --prefix ftgl)/lib/*.dylib ./ftgl
- name: Upload Raw Build Artifacts
if: ${{ inputs.cacheOnly == 'false' }}
uses: actions/upload-artifact@v4
with:
name: osx-build-artifacts
name: osx-${{ runner.arch }}-build-artifacts
path: |
${{ github.workspace }}/build
${{ github.workspace }}/deploy
retention-days: 1

0 comments on commit d1ae12b

Please sign in to comment.