X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c6c651a170f4d277be752dc5115ac13975dab771..c5f8dbbcfb10a8a1c797d0fe1671d7f7698cf6cd:/.github/workflows/git.yml diff --git a/.github/workflows/git.yml b/.github/workflows/git.yml index 8ea42fecd2..39d03c27d6 100644 --- a/.github/workflows/git.yml +++ b/.github/workflows/git.yml @@ -9,39 +9,55 @@ name: Git builds on: workflow_dispatch jobs: - simgrid-regular: - runs-on: ubuntu-latest + simgrid-regular-ubuntu: + runs-on: ${{ matrix.config.os }}-latest + strategy: + matrix: + config: + - { 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" } permissions: contents: read packages: write steps: - name: Checkout repository - uses: actions/checkout@v2 - + uses: actions/checkout@v3 + - name: Init options + run: | + echo "CC=${{ matrix.config.cc }}" >> $GITHUB_ENV + echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV + - name: prepare for ubuntu + if: matrix.config.os == 'ubuntu' + run: | + sudo apt-get update && sudo apt-get install ninja-build libboost-dev libboost-context-dev pybind11-dev + - name: prepare for macos + if: matrix.config.os == 'macos' + run: brew install boost eigen pybind11 ninja - name: build run: | - sudo apt update && sudo apt-get install ninja-build libboost-dev libboost-context-dev libns3-dev + mkdir build ; cd build cmake -GNinja -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \ -Denable_compile_optimizations=ON -Denable_compile_warnings=ON \ -Denable_model-checking=OFF -Denable_smpi_MBI_testsuite=OFF \ -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON \ - -Denable_ns3=ON \ - -DCMAKE_DISABLE_SOURCE_CHANGES=ON -DLTO_EXTRA_FLAG="auto" - ninja tests VERBOSE=1 - ctest --output-on-verbose + -DCMAKE_DISABLE_SOURCE_CHANGES=ON -DLTO_EXTRA_FLAG="auto" .. + ninja tests + ctest --output-on-failure -j$(nproc) - name: Create the failure Message if: ${{ failure() }} run: | - ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building STABLE docker image v3.$ver! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json + ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building simgrid on ${{ matrix.config.name }}! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json - name: Create the success Message if: ${{ success() }} run: | - ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker STABLE image v3.$ver built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json - - uses: mattermost/action-mattermost-notify@master + ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"SimGrid built successfully on ${{ matrix.config.name }}! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json + - uses: komarnitskyi/action-mattermost-notification@v0.1.2-beta + if: ${{ always() }} env: - MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} - MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}} + webhook: ${{ secrets.MATTERMOST_WEBHOOK_URL }} + channel: ${{ secrets.MATTERMOST_CHANNEL}} + json: mattermost.json simgrid-modelcheck-ubuntu: @@ -52,29 +68,32 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: build run: | - sudo apt update && sudo apt-get install ninja-build libboost-dev libboost-context-dev + sudo apt-get update && sudo apt-get install ninja-build libboost-dev libboost-context-dev pybind11-dev + sudo apt-get install libunwind-dev libdw-dev libelf-dev libevent-dev + mkdir build ; cd build cmake -GNinja -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \ -Denable_compile_optimizations=ON -Denable_compile_warnings=ON \ -Denable_model-checking=ON -Denable_smpi_MBI_testsuite=OFF \ -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF \ -Denable_ns3=OFF \ - -DCMAKE_DISABLE_SOURCE_CHANGES=ON -DLTO_EXTRA_FLAG="auto" - ninja tests VERBOSE=1 - ctest --output-on-verbose + -DCMAKE_DISABLE_SOURCE_CHANGES=ON -DLTO_EXTRA_FLAG="auto" .. + ninja tests + ctest --output-on-failure -j$(nproc) - name: Create the failure Message if: ${{ failure() }} run: | - ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building STABLE docker image v3.$ver! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json + ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building simgrid Modelchecker on ubuntu-stable! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json - name: Create the success Message if: ${{ success() }} run: | - ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker STABLE image v3.$ver built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json - - uses: mattermost/action-mattermost-notify@master + ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Simgrid Modelchecker built successfully on ubuntu-stable! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json + - uses: komarnitskyi/action-mattermost-notification@v0.1.2-beta + if: ${{ always() }} env: - MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} - MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}} - + webhook: ${{ secrets.MATTERMOST_WEBHOOK_URL }} + channel: ${{ secrets.MATTERMOST_CHANNEL}} + json: mattermost.json