Skip to content

Commit

Permalink
Some improvements to macOS CI (#446)
Browse files Browse the repository at this point in the history
* SSH intro runner [skip ci]

* Fix cobol paths [skip ci]

* SSH to try commands [skip ci]

* Enable C [skip ci]

* Debugging [skip ci]

* Fix tcc paths [skip ci]

* Fix typo

* more debugging [skip ci]

* Add libclang paths [skip ci]

* Remove Tcc installation [skip ci]

* fix Tcc installation [skip ci]

* Avoid assuming bash in python [skip ci]

* Avoid assuming bash in ruby [skip ci]

* Avoid assuming bash in ruby [skip ci]

* SSH [skip ci]

* Fix java path [skip ci]

* Fix java path [skip ci]

* Fix java path [skip ci]

* Avoid assuming bash [skip ci]

* Avoid assuming bash [skip ci]

* Avoid assuming bash [skip ci]

* SSH [skip ci]

* Avoid assuming bash [skip ci]

* Try to fix jni [skip ci]

* Try fixing java paths [skip ci]

* Try fixing java paths [skip ci]

* Final touch

* Revert C changes

* Update macos-test.yml

---------

Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com>
  • Loading branch information
ahmedihabb2 and viferga authored Jun 30, 2023
1 parent 90adf3e commit a71f81f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
options: [
options: [
{build: debug, sanitizer: without-sanitizer},
{build: debug, sanitizer: address-sanitizer},
{build: debug, sanitizer: thread-sanitizer},
Expand Down Expand Up @@ -53,22 +53,31 @@ jobs:
RUBY_FRAMEWORK_DIR=$(xcrun --sdk macosx --show-sdk-path)/System/Library/Frameworks/Ruby.framework
sudo rm -rf $RUBY_FRAMEWORK_DIR
- name: Uninstall Java
run: |
sudo rm -rf /Library/Java/JavaVirtualMachines/*
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
unset JAVA_HOME
- name: Set up the environment
run: sh ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS
env:
METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol #netcore5 c rust rapidjson funchook swig pack # clangformat v8rep51 coverage
METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol #netcore5 rust rapidjson funchook swig pack # clangformat v8rep51 coverage

- name: Configure
run: |
cd build
. .env
bash ../tools/metacall-configure.sh $METACALL_CONFIGURE_OPTIONS
env:
METACALL_CONFIGURE_OPTIONS: ${{ matrix.options.build }} ${{ matrix.options.sanitizer }} scripts ports tests sanitizer python nodejs typescript java ruby wasm rpc file cobol # netcore5 c rust examples install pack benchmarks # v8 coverage
METACALL_CONFIGURE_OPTIONS: ${{ matrix.options.build }} ${{ matrix.options.sanitizer }} scripts ports tests python nodejs typescript java ruby wasm rpc file cobol benchmarks install # netcore5 c rust examples pack # v8 coverage

- name: Build
working-directory: ./build
# TODO: Remove the disable option for fork safe once funchook problem is solved
run: |
. .env
cmake -DOPTION_FORK_SAFE=OFF ..
bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS
env:
Expand Down
26 changes: 15 additions & 11 deletions tools/metacall-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ sub_python(){
pyenv install 3.11.1
pyenv global 3.11.1
pyenv rehash

# TODO: Avoid this, do no asume bash, find a better way to deal with environment variables
echo -e '\nif command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
source ~/.bash_profile

mkdir -p build
CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt"
ENV_FILE="$ROOT_DIR/build/.env"

echo eval "$(pyenv init -)" >> $ENV_FILE
. $ENV_FILE

echo "-DPython3_INCLUDE_DIRS=$HOME/.pyenv/versions/3.11.1/include/python3.11" >> $CMAKE_CONFIG_PATH
echo "-DPython3_LIBRARY=$HOME/.pyenv/versions/3.11.1/lib/libpython3.11.dylib" >> $CMAKE_CONFIG_PATH
echo "-DPython3_EXECUTABLE=$HOME/.pyenv/versions/3.11.1/bin/python3.11" >> $CMAKE_CONFIG_PATH
Expand Down Expand Up @@ -226,19 +226,15 @@ sub_ruby(){
fi
elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then
brew install ruby@3.2

# TODO: Avoid this, do no asume bash, find a better way to deal with environment variables
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

brew link ruby@3.2 --force --overwrite
mkdir -p build
CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt"
RUBY_PREFIX="$(brew --prefix ruby@3.2)"
RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION')"
echo "-DRuby_INCLUDE_DIR=$RUBY_PREFIX/include/ruby-3.2.0" >> $CMAKE_CONFIG_PATH
echo "-DRuby_LIBRARY=$RUBY_PREFIX/lib/libruby.3.2.dylib" >> $CMAKE_CONFIG_PATH
echo "-DRuby_EXECUTABLE=$RUBY_PREFIX/bin/ruby" >> $CMAKE_CONFIG_PATH
echo "-DRuby_VERSION_STRING=$RUBY_VERSION" >> $CMAKE_CONFIG_PATH
echo "-DRuby_VERSION=$RUBY_VERSION" >> $CMAKE_CONFIG_PATH
fi
}

Expand Down Expand Up @@ -572,6 +568,14 @@ sub_java(){
fi
elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then
brew install openjdk@17
sudo ln -sfn $(brew --prefix openjdk@17)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
JAVA_PREFIX=$(/usr/libexec/java_home -v 17)
mkdir -p build
CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt"
echo "-DJAVA_HOME=$JAVA_PREFIX" >> $CMAKE_CONFIG_PATH
echo "-DJAVA_INCLUDE_PATH=$JAVA_PREFIX/include" >> $CMAKE_CONFIG_PATH
echo "-DJAVA_INCLUDE_PATH2=$JAVA_PREFIX/include/darwin" >> $CMAKE_CONFIG_PATH
echo "-DJAVA_AWT_INCLUDE_PATH=$JAVA_PREFIX/include" >> $CMAKE_CONFIG_PATH
fi
}

Expand Down

0 comments on commit a71f81f

Please sign in to comment.