Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add macos build to github action, untested
[simgrid.git] / .github / workflows / git.yml
1 name: Git builds
2
3 # This workflow uses actions that are not certified by GitHub.
4 # They are provided by a third-party and are governed by
5 # separate terms of service, privacy policy, and support
6 # documentation.
7
8 # Only trigger manually
9 on: workflow_dispatch
10
11 jobs:
12   simgrid-regular-ubuntu:
13     runs-on: ${{ matrix.config.os }}-latest
14     strategy:
15         matrix:
16           config:
17           - { name: "Ubuntu gcc", os: ubuntu, cc: "gcc", cxx: "g++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
18           - { name: "MacOS clang", os: macos, cc: "clang", cxx: "clang++", generator: "Unix Makefiles", cmake_extra_options: "-DLTO_EXTRA_FLAG=auto" }
19     permissions:
20       contents: read
21       packages: write
22
23     steps:
24       - name: Checkout repository
25         uses: actions/checkout@v2
26       - name: Init options
27         run: |
28           echo "CC=${{ matrix.config.cc }}"   >> $GITHUB_ENV
29           echo "CXX=${{ matrix.config.cxx }}" >> GITHUB_ENV
30       - name: prepare for ubuntu
31         if: matrix.config.os == 'ubuntu'
32         run: |
33           sudo apt-get update && sudo apt-get install ninja-build libboost-dev libboost-context-dev pybind11-dev
34           sudo apt-get install libunwind-dev libdw-dev libelf-dev libevent-dev
35       - name: prepare for macos
36         if: matrix.config.os == 'macos'
37         run: brew install boost eigen pybind11 ninja
38       - name: build
39         run: |
40           mkdir build ; cd build
41           cmake -GNinja -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
42                 -Denable_compile_optimizations=ON -Denable_compile_warnings=ON \
43                 -Denable_model-checking=OFF -Denable_smpi_MBI_testsuite=OFF \
44                 -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON \
45                 -DCMAKE_DISABLE_SOURCE_CHANGES=ON  -DLTO_EXTRA_FLAG="auto" ..
46           ninja tests
47           ctest --output-on-failure
48       - name: Create the failure Message
49         if: ${{ failure() }}
50         run: |
51           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
52       - name: Create the success Message
53         if: ${{ success() }}
54         run: |
55           ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Simgrid built on successfully on ${{ matrix.config.name }}! successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
56       - uses: mattermost/action-mattermost-notify@master
57         env:
58           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
59           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
60
61   simgrid-modelcheck-ubuntu:
62
63     runs-on: ubuntu-latest
64     permissions:
65       contents: read
66       packages: write
67
68     steps:
69       - name: Checkout repository
70         uses: actions/checkout@v2
71
72       - name: build
73         run: |
74           sudo apt-get update && sudo apt-get install ninja-build libboost-dev libboost-context-dev pybind11-dev
75           sudo apt-get install libunwind-dev libdw-dev libelf-dev libevent-dev
76           mkdir build ; cd build
77           cmake -GNinja -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
78                 -Denable_compile_optimizations=ON -Denable_compile_warnings=ON \
79                 -Denable_model-checking=ON -Denable_smpi_MBI_testsuite=OFF \
80                 -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF \
81                 -Denable_ns3=OFF \
82                 -DCMAKE_DISABLE_SOURCE_CHANGES=ON  -DLTO_EXTRA_FLAG="auto" ..
83           ninja tests
84           ctest --output-on-failure
85       - name: Create the failure Message
86         if: ${{ failure() }}
87         run: |
88           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
89       - name: Create the success Message
90         if: ${{ success() }}
91         run: |
92           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
93       - uses: mattermost/action-mattermost-notify@master
94         env:
95           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
96           MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
97