Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This should be fixed by now, remove the workaround ( https://github.com/ScoopInstalle...
[simgrid.git] / .github / workflows / jarfile.yml
index 9d7766b..793026e 100644 (file)
@@ -1,7 +1,10 @@
-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
@@ -16,8 +19,8 @@ jobs:
      # install dependencies
     - name: Init options
       run: |
-          echo "::set-env name=CC::${{ matrix.config.cc }}"
-          echo "::set-env name=CXX::${{ matrix.config.cxx }}"
+          echo "CC=${{ matrix.config.cc }}"   >> $GITHUB_ENV
+          echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
     - name: Install boost on ubuntu
       if: matrix.config.os == 'ubuntu'
       run: sudo apt-get update && sudo apt-get install -yq libboost-dev
@@ -29,9 +32,18 @@ jobs:
       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"
+        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
+          $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"
+          (New-Object System.Net.WebClient).DownloadFile($url, "$env:TEMP\boost.tar.gz")
+          7z.exe x "$env:TEMP\boost.tar.gz" -o"$env:TEMP\boostArchive" -y | Out-Null
+          7z.exe x "$env:TEMP\boostArchive" -o"$env:TEMP\boost" -y | Out-Null
+          Push-Location -Path "$env:TEMP\boost"
+          Invoke-Expression .\setup.ps1
+        }
+        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
       run: |
           mkdir build
@@ -43,7 +55,15 @@ jobs:
       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
@@ -79,3 +99,15 @@ jobs:
             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}}