openssl set static in rabbitmq-c repo #433
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 is a basic workflow to help you get started with Actions | |
name: rabbitmq | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the development branch | |
push: | |
branches: [ master, development] | |
pull_request: | |
branches: [ master, development] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
#os: [ ubuntu-20.04, windows-latest, macos-latest ] | |
#os: [ubuntu-20.04] | |
os: [windows-latest] | |
steps: | |
- uses: TheMrMilchmann/setup-msvc-dev@v3 | |
if: matrix.os == 'windows-latest' | |
with: | |
arch: x64 | |
- uses: actions/checkout@v2 | |
if: matrix.os == 'ubuntu-20.04' | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: actions/checkout@v2 | |
if: matrix.os != 'ubuntu-20.04' | |
with: | |
submodules: true | |
- name: get rabbitmq Ubuntu ONLY | |
if: matrix.os == 'ubuntu-20.04' | |
uses: getong/[email protected] | |
with: | |
rabbitmq version: '3.8.2-management' | |
host port: 5672 | |
rabbitmq user: 'guest' | |
rabbitmq password: 'guest' | |
- uses: lukka/[email protected] | |
- name: Prepare variables for ubuntu | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
echo "linux-x64" > target | |
echo "linux-x86_64" > install_name | |
echo " " > cmakeFlag | |
echo " " > cmakeFlagValue | |
- name: Set up CLANG | |
if: matrix.os == 'ubuntu-20.04' | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: latest | |
platform: x64 | |
- name: Prepare variables for windows | |
shell: bash | |
if: matrix.os == 'windows-latest' | |
run: | | |
openssl version | |
which libcrypto-1_1-x64.dll | |
echo "win-x64" > target | |
echo "win-x86_64" > install_name | |
echo -G > cmakeFlag | |
echo Unix Makefiles > cmakeFlagValue | |
- name: Other win prep | |
if: matrix.os == 'windows-latest' | |
run: | | |
dir "C:\Program Files\OpenSSL\lib" | |
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Prepare variables for macos | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo "darwin-x64" > target | |
echo "darwin-x86_64" > install_name | |
echo " " > cmakeFlag | |
echo " " > cmakeFlagValue | |
- name: Fix openssl | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install openssl | |
brew upgrade openssl | |
brew link --force openssl | |
echo '' >> /Users/runner/.bash_profile | |
echo 'export LDFLAGS="-L/usr/local/opt/openssl@3/lib"' >> /Users/runner/.bash_profile | |
echo 'export CPPFLAGS="-I/usr/local/opt/openssl@3/include"' >> /Users/runner/.bash_profile | |
echo 'export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"' >> /Users/runner/.bash_profile | |
echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile | |
tail /Users/runner/.bash_profile | |
- name: Build | |
shell: bash | |
run: | | |
export target=$(cat target) | |
export install_name=$(cat install_name) | |
export cmakeFlag=$(cat cmakeFlag) | |
export cmakeFlagValue=$(cat cmakeFlagValue) | |
echo $target | |
echo $install_name | |
repo=$(git rev-parse --show-toplevel) | |
current_dir=$(pwd) | |
cd $repo | |
working_dir=build/$target | |
mkdir -p $working_dir | |
echo Build dependencies | |
build_xercersc() | |
{ | |
if [ $target == "linux-x64" ]; then | |
transcoder_option="-Dtranscoder=gnuiconv" | |
else | |
transcoder_option="" | |
fi | |
echo cmake $3 "$4" -B$1 -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_INSTALL_PREFIX=$2 -Dthreads:BOOL=OFF -Dnetwork:BOOL=OFF $transcoder_option -Hthirdparty/xerces-c | |
cmake $3 "$4" -B$1 -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_INSTALL_PREFIX=$2 -Dthreads:BOOL=OFF -Dnetwork:BOOL=OFF $transcoder_option -Hthirdparty/xerces-c | |
make -C$1 -j8 | |
make -C$1 install | |
} | |
if [ ! -d build/external/$install_name ] | |
then | |
echo build_xercersc $working_dir/xerces-c build/external/$install_name $cmakeFlag "$cmakeFlagValue" | |
build_xercersc $working_dir/xerces-c build/external/$install_name $cmakeFlag "$cmakeFlagValue" | |
else | |
echo "Dependency already generated" | |
fi | |
echo Running CMake | |
rm -f thirdparty/rabbitmq-c/rabbitmq-c/librabbitmq/config.h | |
cmake $cmakeFlag "$cmakeFlagValue" -B$working_dir -H. | |
echo Compiling | |
make -C$working_dir -j8 | |
make -C$working_dir/rabbitmq-fmu install | |
cd $current_dir | |
echo Done | |
echo $(pwd) | |
ls | |
- name: List dependencies for ubuntu | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
echo "$RUNNER_OS" | |
lsb_release -a | |
echo Dependencies | |
- name: List dependencies for windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo "$RUNNER_OS" | |
systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version" | |
echo Dependencies | |
dumpbin /dependents build/win-x64/rabbitmq-fmu/rabbitmq.dll | |
- name: List dependencies for macos | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo "$RUNNER_OS" | |
sw_vers | |
echo Dependencies | |
otool -L build/darwin-x64/rabbitmq-fmu/rabbitmq.dylib | |
- name: Run unit tests on UNIX | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
export target=$(cat target) | |
echo $(pwd) | |
echo About to run unit-test-rabbitmq and unit-test-rabbitmq-core | |
ctest --test-dir build/$target -R unit-test-rabbitmq | |
echo Tests complete | |
- name: Run unit tests on WIN | |
#echo About to run unit-test-rabbitmq and unit-test-rabbitmq-core | |
#ctest --output-on-failure --test-dir build/$target -R unit-test-rabbitmq | |
#echo Tests complete | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
export target=$(cat target) | |
echo $(pwd) | |
pacman -S --noconfirm mingw-w64-x86_64-gcc-libs | |
cmake --install build/$target | |
echo check for dll dependencies for the core test | |
ldd build/$target/rabbitmq-core/unit-test-rabbitmq-core.exe | |
echo check for dll dependencies for the container test | |
ldd build/$target/rabbitmq-fmu/unit-test-rabbitmq.exe | |
#Call ctest | |
ctest --test-dir build/$target --output-on-failure -R unit-test-rabbitmq | |
echo Tests complete | |
- name : Prep for integration tests UBUNTU # these need additional scripts that produce data to the rabbitmq, require rabbitmq server | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
cd rmqfmu-example/old_scripts | |
ls | |
python3 -m pip install pika --upgrade | |
nohup python3 playback_gazebo_data-test.py & exit | |
- name: Run integration tests UBUNTU # there are no integration tests yet for the core. | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
export target=$(cat target) | |
cp modelDescription.xml build/$target/rabbitmq-fmu/ | |
./build/$target/rabbitmq-core/it-test-rabbitmq-core | |
./build/$target/rabbitmq-fmu/it-test-rabbitmq | |
- name: Upload artifact macos | |
if: matrix.os == 'macos-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rabbitmq.dylib | |
path: build/darwin-x64/rabbitmq-fmu/rabbitmq.dylib | |
- name: Upload artifact linux | |
if: matrix.os == 'ubuntu-20.04' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rabbitmq.so | |
path: build/linux-x64/rabbitmq-fmu/rabbitmq.so | |
- name: Upload artifact windows | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rabbitmq.dll | |
path: build/win-x64/rabbitmq-fmu/rabbitmq.dll | |
- name: Upload artifact windows | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: it-test-rabbitmq.exe | |
path: build/win-x64/rabbitmq-fmu/it-test-rabbitmq.exe | |
- name: Upload artifact windows | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: unit-test-rabbitmq.exe | |
path: build/win-x64/rabbitmq-fmu/unit-test-rabbitmq.exe | |
- name: Upload artifact windows | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: unit-test-rabbitmq-core.exe | |
path: build/win-x64/rabbitmq-core/unit-test-rabbitmq-core.exe | |
- name: Upload artifact windows | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: it-test-rabbitmq-core.exe | |
path: build/win-x64/rabbitmq-core/it-test-rabbitmq-core.exe | |
- name: Update version on modelDescription.xml | |
shell: bash | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
cd rabbitmq-fmu/ | |
../scripts/set_fmu_version.sh modelDescription.xml | |
- name: Upload modelDescription.xml | |
if: matrix.os == 'ubuntu-20.04' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: modelDescription.xml | |
path: rabbitmq-fmu/modelDescription.xml | |
- name: Upload rabbitmq configuration script | |
if: matrix.os == 'ubuntu-20.04' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rabbitmq_fmu_configure.py | |
path: scripts/rabbitmq_fmu_configure.py | |
- name: Upload readme | |
if: matrix.os == 'ubuntu-20.04' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: readme.md | |
path: readme.md | |
pack-fmu: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Download dll | |
uses: actions/download-artifact@v2 | |
with: | |
name: rabbitmq.dll | |
path: rabbitmq/binaries/win64/ | |
- name: Download shared library | |
uses: actions/download-artifact@v2 | |
with: | |
name: rabbitmq.so | |
path: rabbitmq/binaries/linux64/ | |
- name: Download dylib | |
uses: actions/download-artifact@v2 | |
with: | |
name: rabbitmq.dylib | |
path: rabbitmq/binaries/darwin64/ | |
- name: Download model description file | |
uses: actions/download-artifact@v2 | |
with: | |
name: modelDescription.xml | |
path: rabbitmq/ | |
- name: Download model description file to resources folder | |
uses: actions/download-artifact@v2 | |
with: | |
name: modelDescription.xml | |
path: rabbitmq/resources | |
- name: Download readme | |
uses: actions/download-artifact@v2 | |
with: | |
name: readme.md | |
path: rabbitmq/ | |
- name: Download configuration script | |
uses: actions/download-artifact@v2 | |
with: | |
name: rabbitmq_fmu_configure.py | |
path: rabbitmq/ | |
- name: Get version of the tool | |
run: | | |
cd rabbitmq-fmu/ | |
echo "::set-output name=VERSION::$(git describe --tags --long)" | |
id: version | |
- name: Upload FMU | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rabbitmq-${{steps.version.outputs.VERSION}}.fmu | |
path: rabbitmq | |