Skip to content

Commit

Permalink
Merge pull request #154 from skalenetwork/enhancement/fix-macos-build
Browse files Browse the repository at this point in the history
add macos build and test
  • Loading branch information
olehnikolaiev authored Aug 18, 2021
2 parents 45f2517 + 5907537 commit c7c5c84
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(cat VERSION)
export VERSION=$(cat VERSION.txt)
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION)
echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION"
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,40 @@ jobs:
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f coverage.info -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
build_osx:
runs-on: macos-11

steps:
- name: Extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Checkout
uses: actions/checkout@v2
- name: Install packages
run: |
brew install yasm texinfo shtool libtool coreutils
- name: Build dependencies
run: |
cd deps
./build.sh
- name: Configure all
run: |
mkdir -p build && cd build
cmake ..
- name: Build all
run: |
cd build
make -j$(sysctl -n hw.ncpu)
- name: Run tests
run: |
cp scripts/parameters.json build/
cd build
./bls_unit_test
./dkg_unit_test
./bls_test
./threshold_encryption/te_unit_test
./threshold_encryption/te_test
./dkg_attack
File renamed without changes.
14 changes: 12 additions & 2 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,13 @@ then
then
sed -i -e 's#using gcc ;#using gcc : arm : /usr/local/toolchains/gcc7.2-arm/bin/arm-linux-gnueabihf-g++ ;#g' project-config.jam
./b2 "${CONF_CROSSCOMPILING_OPTS_BOOST}" cxxflags=-fPIC cflags=-fPIC ${PARALLEL_MAKE_OPTIONS} --prefix="$INSTALL_ROOT" --layout=system variant=debug link=static threading=multi install
else
if [ "$UNIX_SYSTEM_NAME" = "Darwin" ];
then
./b2 cxxflags=-fPIC toolset=clang cxxstd=14 cflags=-fPIC ${PARALLEL_MAKE_OPTIONS} --prefix="$INSTALL_ROOT" --layout=system variant=debug link=static threading=multi install
else
./b2 cxxflags=-fPIC cxxstd=14 cflags=-fPIC ${PARALLEL_MAKE_OPTIONS} --prefix="$INSTALL_ROOT" --layout=system variant=debug link=static threading=multi install
./b2 cxxflags=-fPIC cxxstd=14 cflags=-fPIC ${PARALLEL_MAKE_OPTIONS} --prefix="$INSTALL_ROOT" --layout=system variant=debug link=static threading=multi install
fi
fi
cd ..
cd "$SOURCES_ROOT"
Expand Down Expand Up @@ -671,7 +676,12 @@ then
fi
cd gmp-6.1.2
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
./configure ${CONF_CROSSCOMPILING_OPTS_GENERIC} ${CONF_CROSSCOMPILING_OPTS_GMP} ${CONF_DEBUG_OPTIONS} --enable-cxx --enable-static --disable-shared --prefix="$INSTALL_ROOT"
if [ "$UNIX_SYSTEM_NAME" = "Darwin" ];
then
./configure ${CONF_CROSSCOMPILING_OPTS_GENERIC} ${CONF_DEBUG_OPTIONS} --enable-cxx --enable-static --disable-shared --build=x86_64-apple-darwin#{OS.kernel_version.major} --prefix="$INSTALL_ROOT"
else
./configure ${CONF_CROSSCOMPILING_OPTS_GENERIC} ${CONF_CROSSCOMPILING_OPTS_GMP} ${CONF_DEBUG_OPTIONS} --enable-cxx --enable-static --disable-shared --prefix="$INSTALL_ROOT"
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
$MAKE ${PARALLEL_MAKE_OPTIONS}
$MAKE ${PARALLEL_MAKE_OPTIONS} install
Expand Down
2 changes: 2 additions & 0 deletions deps/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ rm -rf ./deps_inst
rm -rf ./build
echo "Cleaning archive files..."
rm -f ./*.tar.gz
rm -f ./*.tar.xz
rm -f ./*.tar.bz2
rm -f ./*.zip
echo "Cleaning upacked library folders..."
rm -rf ./libiconv-1.15
Expand Down

0 comments on commit c7c5c84

Please sign in to comment.