6 # * is a special character in YAML so you have to quote this string
10 runs-on: ${{ matrix.config.os }}-latest
14 - { name: "Ubuntu gcc", os: ubuntu, cc: "gcc", cxx: "g++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
15 - { name: "MacOS clang", os: macos, cc: "clang", cxx: "clang++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
17 - uses: actions/checkout@v2
18 # install dependencies
21 echo "CC=${{ matrix.config.cc }}" >> $GITHUB_ENV
22 echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
23 - name: Install boost and eigen on ubuntu
24 if: matrix.config.os == 'ubuntu'
25 run: sudo apt-get update && sudo apt-get install -yq libboost-dev libeigen3-dev
26 - name: Install boost and eigen on macos
27 if: matrix.config.os == 'macos'
28 run: brew install boost eigen
29 - name: Build and test jar with Cmake
33 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 }}" ..
34 make -j2 simgrid-java_jar java-all
35 ctest -R java --output-on-failure
37 uses: actions/upload-artifact@v2
39 name: jar-${{ matrix.config.os }}
40 path: build/simgrid.jar
41 - name: Create the failure Message
44 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
45 - uses: mattermost/action-mattermost-notify@master
48 MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
49 MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
52 runs-on: ubuntu-latest
54 - uses: actions/checkout@v2
55 - name: Download all jars from ubuntu
56 uses: actions/download-artifact@v2
57 - name: Build final jar
59 patch=$(grep -r set\(SIMGRID_VERSION_PATCH ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
60 major=$(grep -r set\(SIMGRID_VERSION_MAJOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
61 minor=$(grep -r set\(SIMGRID_VERSION_MINOR ./CMakeLists.txt | sed 's/.*"\([[:digit:]]\+\)".*/\1/g')
62 if [ $patch -ne 0 ]; then
63 version="$major.$minor.$patch"
65 version="$major.$minor"
69 for j in ubuntu macos ; do unzip -n ../jar-$j/simgrid.jar ; done
71 x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
72 zip -r ../simgrid-${version}.jar *
74 uses: actions/upload-artifact@v2
78 - name: cleanup artifacts
79 uses: geekyeggo/delete-artifact@v1
84 - name: Create the failure Message
87 echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when assembling JAR file ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
88 - name: Create the success Message
91 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
92 - uses: mattermost/action-mattermost-notify@master
94 MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
95 MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}