Update readme.md #575
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, kel/openssl] | |
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-22.04, windows-latest, macos-13 ] | |
# os: [ windows-latest] | |
steps: | |
# - uses: TheMrMilchmann/setup-msvc-dev@v3 | |
# if: matrix.os == 'windows-latest' | |
# with: | |
# arch: x64 | |
#- name: Put MSYS2_MinGW64 on PATH for windows | |
#if: matrix.os == 'windows-latest' | |
# there is not yet an environment variable for this path from msys2/setup-msys2 | |
# We need this to get a gcc 11.2 that is new enough to compile the reference FMU3 | |
#run: echo "C:\msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
#run: echo "C:\msys64/mingw64/bin" >> "$GITHUB_PATH" | |
- uses: msys2/setup-msys2@v2 | |
if: matrix.os == 'windows-latest' | |
with: | |
install: >- | |
curl | |
git | |
mingw-w64-x86_64-toolchain | |
base-devel | |
mingw-w64-x86_64-cmake | |
mingw-w64-x86_64-gcc | |
- uses: actions/checkout@v4 | |
if: matrix.os == 'ubuntu-22.04' | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: actions/checkout@v4 | |
if: matrix.os != 'ubuntu-22.04' | |
with: | |
submodules: true | |
- name: Restore external dependencies from cache | |
id: cache-external-deps | |
uses: actions/cache@v4 | |
with: | |
path: build/external/ | |
key: ${{ runner.os }}-external-deps | |
- name: Check if external dependencies are in the cache | |
if: steps.cache-external-deps.outputs.cache-hit == 'true' | |
run: echo External dependencies already generated | |
# why this one: in order to run the integration test | |
- name: get rabbitmq Ubuntu ONLY | |
if: matrix.os == 'ubuntu-22.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] | |
if: matrix.os != 'windows-latest' | |
- name: Build linux | |
if: matrix.os == 'ubuntu-22.04' | |
shell: bash | |
run: ./scripts/_build_base.sh linux-x64 linux-x86_64 | |
- name: Build Mac | |
if: matrix.os == 'macos-13' | |
shell: bash | |
run: ./scripts/_build_base.sh darwin-x64 darwin-x86_64 | |
- name: Build Windows | |
if: matrix.os == 'windows-latest' | |
shell: msys2 {0} | |
run: | | |
./scripts/_build_base.sh win-x64 win-x86_64 | |
- name: List dependencies for ubuntu | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
echo "$RUNNER_OS" | |
lsb_release -a | |
echo Dependencies | |
ldd build/linux-x64/rabbitmq-fmu/rabbitmq.so | |
continue-on-error: true | |
- 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-13' | |
run: | | |
echo "$RUNNER_OS" | |
sw_vers | |
echo Dependencies | |
otool -L build/darwin-x64/rabbitmq-fmu/rabbitmq.dylib | |
- name: Run unit tests on UBUNTU | |
if: matrix.os == 'ubuntu-22.04' | |
shell: bash | |
run: | | |
echo About to run unit-test-rabbitmq and unit-test-rabbitmq-core | |
ctest --test-dir build/linux-x64 -R unit-test-rabbitmq | |
echo Tests complete | |
- name: Run unit tests on MACOS | |
if: matrix.os == 'macos-13' | |
shell: bash | |
run: | | |
echo About to run unit-test-rabbitmq and unit-test-rabbitmq-core | |
ctest --test-dir build/darwin-x64 -R unit-test-rabbitmq | |
echo Tests complete | |
- name: Run unit tests on WIN | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
ctest --test-dir build/win-x64 --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; add -u to see script output | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
cd rmqfmu-example/old_scripts | |
python3 -m pip install pika --upgrade | |
echo Run playback_gazebo_data-test.py | |
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-22.04' | |
run: | | |
cp modelDescription.xml build/linux-x64/rabbitmq-fmu/ | |
echo Running it-test-rabbitmq-core | |
./build/linux-x64/rabbitmq-core/it-test-rabbitmq-core | |
echo Running it-test-rabbitmq | |
./build/linux-x64/rabbitmq-fmu/it-test-rabbitmq | |
- name: Upload artifact macos | |
if: matrix.os == 'macos-13' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rabbitmq.dylib | |
path: build/darwin-x64/rabbitmq-fmu/rabbitmq.dylib | |
- name: Upload artifact linux | |
if: matrix.os == 'ubuntu-22.04' | |
uses: actions/upload-artifact@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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-22.04' | |
run: | | |
cd rabbitmq-fmu/ | |
../scripts/set_fmu_version.sh modelDescription.xml | |
- name: Upload modelDescription.xml | |
if: matrix.os == 'ubuntu-22.04' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: modelDescription.xml | |
path: rabbitmq-fmu/modelDescription.xml | |
- name: Upload rabbitmq configuration script | |
if: matrix.os == 'ubuntu-22.04' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rabbitmq_fmu_configure.py | |
path: scripts/rabbitmq_fmu_configure.py | |
- name: Upload readme | |
if: matrix.os == 'ubuntu-22.04' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: readme.md | |
path: readme.md | |
pack-fmu: | |
runs-on: ubuntu-22.04 | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Download dll | |
uses: actions/download-artifact@v4 | |
with: | |
name: rabbitmq.dll | |
path: rabbitmq/binaries/win64/ | |
- name: Download shared library | |
uses: actions/download-artifact@v4 | |
with: | |
name: rabbitmq.so | |
path: rabbitmq/binaries/linux64/ | |
- name: Download dylib | |
uses: actions/download-artifact@v4 | |
with: | |
name: rabbitmq.dylib | |
path: rabbitmq/binaries/darwin64/ | |
- name: Download model description file | |
uses: actions/download-artifact@v4 | |
with: | |
name: modelDescription.xml | |
path: rabbitmq/ | |
- name: Download model description file to resources folder | |
uses: actions/download-artifact@v4 | |
with: | |
name: modelDescription.xml | |
path: rabbitmq/resources | |
- name: Download readme | |
uses: actions/download-artifact@v4 | |
with: | |
name: readme.md | |
path: rabbitmq/ | |
- name: Download configuration script | |
uses: actions/download-artifact@v4 | |
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@v4 | |
with: | |
name: rabbitmq-${{steps.version.outputs.VERSION}}.fmu | |
path: rabbitmq | |