-name: SimGrid complete jar file generation
+name: Jar build
on:
workflow_dispatch:
strategy:
matrix:
config:
- - { name: "Windows MingW", os: windows, cc: "gcc", cxx: "g++", generator: "MinGW Makefiles", cmake_extra_options: "-Denable_lto=OFF" }
+ - { name: "Windows MingW", os: windows, cc: "gcc", cxx: "g++", generator: "MinGW Makefiles", cmake_extra_options: '-Denable_lto=OFF -DCMAKE_PREFIX_PATH="C:/Program Files/Eigen3/"' }
- { name: "Ubuntu gcc", os: ubuntu, cc: "gcc", cxx: "g++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
- { name: "MacOS clang", os: macos, cc: "clang", cxx: "clang++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
steps:
run: |
echo "CC=${{ matrix.config.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
- - name: Install boost on ubuntu
+ - name: Install boost and eigen on ubuntu
if: matrix.config.os == 'ubuntu'
- run: sudo apt-get update && sudo apt-get install -yq libboost-dev
- - name: Install boost on macos
+ run: sudo apt-get update && sudo apt-get install -yq libboost-dev libeigen3-dev
+ - name: Install boost and eigen on macos
if: matrix.config.os == 'macos'
- run: brew install boost
- - name: Install boost and gcc on windows
+ run: brew install boost eigen
+ - name: Install boost, eigen, and gcc on windows
if: matrix.config.os == 'windows'
run: |
- Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
- (Get-Content ~\scoop\buckets\main\bucket\gcc.json).replace('http://repo.msys2.org/', 'http://mirrors.huaweicloud.com/msys2/') | Set-Content ~\scoop\buckets\main\bucket\gcc.json
+ iwr -useb get.scoop.sh -outfile 'install.ps1'
+ .\install.ps1 -RunAsAdmin
scoop install gcc --global
If ((Test-Path "C:\hostedtoolcache\windows\Boost") -eq $False){
# Use the boost-1.72.0-win32-msvc14.1-x86_64.tar.gz for Windows 2016
echo "BOOST_ROOT=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BOOST_INCLUDEDIR=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64\boost\include" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BOOST_LIBRARYDIR=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64\lib" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- - name: Build jar with Cmake
+ $url = "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz"
+ (New-Object System.Net.WebClient).DownloadFile($url, "$env:TEMP\eigen.tar.gz")
+ Push-Location -Path "$env:TEMP"
+ cmake -E tar zxf "$env:TEMP\eigen.tar.gz"
+ mkdir "$env:TEMP\eigen-3.4.0\build"
+ cd "$env:TEMP\eigen-3.4.0\build"
+ cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="C:\Program Files\Eigen3" ..
+ cmake --build . --target install
+ - name: Build and test jar with Cmake
run: |
mkdir build
cd build
cmake -Denable_documentation=OFF -Denable_java=ON -Denable_msg=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF ${{ matrix.config.cmake_extra_options }} -G "${{ matrix.config.generator }}" ..
- make -j2 simgrid-java_jar
+ make -j2 simgrid-java_jar java-all
+ ctest -j2 -R java
- name: Upload jar
uses: actions/upload-artifact@v2
with:
name: jar-${{ matrix.config.os }}
path: build/simgrid.jar
-
+ - name: Create the failure Message
+ if: ${{ failure() }}
+ run: |
+ echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building JAR file on ${{ matrix.config.name }}! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+ - uses: mattermost/action-mattermost-notify@master
+ if: ${{ failure() }}
+ env:
+ MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
+ MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
create_jar:
needs: build
runs-on: ubuntu-latest
jar-ubuntu
jar-windows
jar-macos
+ - name: Create the failure Message
+ if: ${{ failure() }}
+ run: |
+ echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when assembling JAR file ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+ - name: Create the success Message
+ if: ${{ success() }}
+ run: |
+ echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"JAR file built successfully ! You can get it on: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+ - uses: mattermost/action-mattermost-notify@master
+ env:
+ MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
+ MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}