Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
pthreads are not used anymore. Standard C++ ones are
[simgrid.git] / .github / workflows / jarfile.yml
index 9d7766b..1bd5f87 100644 (file)
@@ -1,14 +1,16 @@
-name: SimGrid complete jar file generation
-
-on: [workflow_dispatch]
+name: Jar build
 
+on:
+  workflow_dispatch:
+  schedule:
+  # * is a special character in YAML so you have to quote this string
+      - cron:  '0 18 * * 0'
 jobs:
   build:
     runs-on: ${{ matrix.config.os }}-latest
     strategy:
         matrix:
           config:
-          - { name: "Windows MingW", os: windows, cc: "gcc", cxx: "g++", generator: "MinGW Makefiles", cmake_extra_options: "-Denable_lto=OFF" }
           - { 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:
@@ -16,34 +18,35 @@ jobs:
      # install dependencies
     - name: Init options
       run: |
-          echo "::set-env name=CC::${{ matrix.config.cc }}"
-          echo "::set-env name=CXX::${{ matrix.config.cxx }}"
-    - name: Install boost on ubuntu
+          echo "CC=${{ matrix.config.cc }}"   >> $GITHUB_ENV
+          echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
+    - 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
-      if: matrix.config.os == 'windows'
-      run: |
-        Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
-        scoop install gcc --global
-        echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_72_0"
-        echo "::set-env name=BOOST_INCLUDEDIR::$env:BOOST_ROOT\boost\include"
-        echo "::set-env name=BOOST_LIBRARYDIR::$env:BOOST_ROOT\lib"
-    - name: Build jar with Cmake
+      run: brew install boost eigen
+    - 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 -R java --output-on-failure
     - 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
@@ -63,7 +66,7 @@ jobs:
            fi
            mkdir content
            cd content
-           for j in  ubuntu macos windows ; do unzip -n ../jar-$j/simgrid.jar ; done
+           for j in  ubuntu macos ; do unzip -n ../jar-$j/simgrid.jar ; done
            strip NATIVE/*/*/*.so
            x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
            zip -r ../simgrid-${version}.jar *
@@ -77,5 +80,16 @@ jobs:
         with:
           name: |
             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}}