1 name: SimGrid complete jar file generation
6 # * is a special character in YAML so you have to quote this string
10 runs-on: ${{ matrix.config.os }}-latest
14 - { name: "Windows MingW", os: windows, cc: "gcc", cxx: "g++", generator: "MinGW Makefiles", cmake_extra_options: "-Denable_lto=OFF" }
15 - { name: "Ubuntu gcc", os: ubuntu, cc: "gcc", cxx: "g++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
16 - { name: "MacOS clang", os: macos, cc: "clang", cxx: "clang++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
18 - uses: actions/checkout@v2
19 # install dependencies
22 echo "CC=${{ matrix.config.cc }}" >> $GITHUB_ENV
23 echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
24 - name: Install boost on ubuntu
25 if: matrix.config.os == 'ubuntu'
26 run: sudo apt-get update && sudo apt-get install -yq libboost-dev
27 - name: Install boost on macos
28 if: matrix.config.os == 'macos'
29 run: brew install boost
30 - name: Install boost and gcc on windows
31 if: matrix.config.os == 'windows'
33 Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
34 (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
35 scoop install gcc --global
36 # Use the boost-1.72.0-win32-msvc14.1-x86_64.tar.gz for Windows 2016
37 $url = "https://github.com/actions/boost-versions/releases/download/1.72.0-20200608.4/boost-1.72.0-win32-msvc14.2-x86_64.tar.gz"
38 (New-Object System.Net.WebClient).DownloadFile($url, "$env:TEMP\boost.tar.gz")
39 7z.exe x "$env:TEMP\boost.tar.gz" -o"$env:TEMP\boostArchive" -y | Out-Null
40 7z.exe x "$env:TEMP\boostArchive" -o"$env:TEMP\boost" -y | Out-Null
41 Push-Location -Path "$env:TEMP\boost"
42 Invoke-Expression .\setup.ps1
43 echo "BOOST_ROOT=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
44 echo "BOOST_INCLUDEDIR=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64\boost\include" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
45 echo "BOOST_LIBRARYDIR=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64\lib" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
46 - name: Build jar with Cmake
50 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 }}" ..
51 make -j2 simgrid-java_jar
53 uses: actions/upload-artifact@v2
55 name: jar-${{ matrix.config.os }}
56 path: build/simgrid.jar
60 runs-on: ubuntu-latest
62 - uses: actions/checkout@v2
63 - name: Download all jars from ubuntu
64 uses: actions/download-artifact@v2
65 - name: Build final jar
67 patch=$(grep -r set\(SIMGRID_VERSION_PATCH ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
68 major=$(grep -r set\(SIMGRID_VERSION_MAJOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
69 minor=$(grep -r set\(SIMGRID_VERSION_MINOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
70 if [ $patch -ne 0 ]; then
71 version="$major.$minor.$patch"
73 version="$major.$minor"
77 for j in ubuntu macos windows ; do unzip -n ../jar-$j/simgrid.jar ; done
79 x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
80 zip -r ../simgrid-${version}.jar *
82 uses: actions/upload-artifact@v2
86 - name: cleanup artifacts
87 uses: geekyeggo/delete-artifact@v1