meson_ci.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ## This Workflow will run when a PR has "meson" label or when something pushed to master.
  2. name: Dinit Meson based CI
  3. on:
  4. push:
  5. branches:
  6. - master
  7. paths:
  8. - '.github/workflows/meson_ci.yml'
  9. - 'build/version.conf'
  10. - 'build/mconfig.mesontemplate'
  11. - 'configs/**'
  12. - 'dasynq/**'
  13. - 'src/**'
  14. - '**/meson.build'
  15. - 'meson_options.txt'
  16. - '!**/Makefile'
  17. pull_request:
  18. types:
  19. - labeled
  20. - opened
  21. - reopened
  22. - synchronize
  23. branches:
  24. - master
  25. paths:
  26. - '.github/workflows/meson_ci.yml'
  27. - 'build/version.conf'
  28. - 'build/mconfig.mesontemplate'
  29. - 'configs/**'
  30. - 'dasynq/**'
  31. - 'src/**'
  32. - '**/meson.build'
  33. - 'meson_options.txt'
  34. - '!**/Makefile'
  35. workflow_dispatch:
  36. jobs:
  37. Debian-bullseye_build:
  38. if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'meson') }}
  39. runs-on: ubuntu-latest
  40. container:
  41. image: debian:bullseye
  42. strategy:
  43. fail-fast: false # Upload src/igr-tests/*/output/* files in igr-tests
  44. matrix:
  45. include:
  46. - arch: 'amd64'
  47. - arch: 'i386'
  48. steps:
  49. - uses: actions/checkout@v4
  50. - name: Add i386 repos
  51. if: ${{ matrix.arch == 'i386' }}
  52. run: dpkg --add-architecture i386
  53. - name: Getting depends (amd64)
  54. if: ${{ matrix.arch == 'amd64' }}
  55. run: |
  56. apt-get update
  57. DEBIAN_FRONTEND=noninteractive apt-get install g++ meson m4 -y
  58. - name: Getting depends (i386)
  59. if: ${{ matrix.arch == 'i386' }}
  60. run: |
  61. apt-get update
  62. DEBIAN_FRONTEND=noninteractive apt-get install meson m4:i386 g++:i386 -y
  63. - name: Setup
  64. run: meson setup -Dunit-tests=true -Digr-tests=true dirbuild
  65. - name: Build
  66. run: meson compile -C dirbuild
  67. - name: Unit tests
  68. run: meson test -v --suite=unit_tests -C dirbuild
  69. - name: Integration tests
  70. run: meson test -v --suite=igr_tests -C dirbuild
  71. - name: Upload igr-tests output file(s) on failure
  72. uses: actions/upload-artifact@v4.3.2
  73. if: failure()
  74. with:
  75. name: igr-tests_output
  76. path: dirbuild/src/igr-tests/*/output/*
  77. MacOS-latest_build:
  78. if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'meson') }}
  79. runs-on: macos-latest
  80. strategy:
  81. fail-fast: false # Upload src/igr-tests/*/output/* files in igr-tests
  82. matrix:
  83. include:
  84. - arch: 'amd64'
  85. steps:
  86. - uses: actions/checkout@v4
  87. - name: Install meson via pip3
  88. run: pip3 install meson
  89. - name: Install ninja
  90. run: brew install ninja
  91. - name: Setup
  92. run: meson setup -Dunit-tests=true -Digr-tests=true dirbuild
  93. - name: Build
  94. run: meson compile -C dirbuild
  95. - name: Unit tests
  96. run: meson test -v --suite=unit_tests -C dirbuild
  97. - name: Integration tests
  98. run: meson test -v --suite=igr_tests -C dirbuild
  99. - name: Upload igr-tests output file(s) on failure
  100. uses: actions/upload-artifact@v4.3.2
  101. if: failure()
  102. with:
  103. name: igr-tests_output
  104. path: dirbuild/src/igr-tests/*/output/*
  105. Alpine-latest_build:
  106. if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'meson') }}
  107. runs-on: ubuntu-latest
  108. strategy:
  109. fail-fast: false # Upload src/igr-tests/*/output/* files in igr-tests
  110. matrix:
  111. include:
  112. - arch: 'armv6'
  113. - arch: 'armv7'
  114. - arch: 'aarch64'
  115. steps:
  116. - uses: actions/checkout@v4
  117. - uses: uraimo/run-on-arch-action@v2.7.2
  118. name: Getting depends & setup & build & unit & integration tests
  119. with:
  120. arch: ${{ matrix.arch }}
  121. distro: alpine_latest
  122. run: |
  123. apk add ncurses
  124. echo "$(tput bold) !---- ${{ matrix.arch }} BUILD ----!$(tput sgr0)"
  125. echo "$(tput bold) ----Getting depends---- :$(tput sgr0) apk update && apk add meson g++ m4"
  126. apk update
  127. apk add meson g++ m4
  128. echo "$(tput bold) ----Setup---- :$(tput sgr0) meson setup -Dunit-tests=true -Digr-tests=true dirbuild"
  129. meson setup -Dunit-tests=true -Digr-tests=true dirbuild
  130. echo "$(tput bold) ----Build---- :$(tput sgr0) meson compile -C dirbuild"
  131. meson compile -C dirbuild
  132. echo "$(tput bold) ----Unit tests---- :$(tput sgr0) meson test -v --suite=unit_tests -C dirbuild"
  133. meson test -v --suite=unit_tests -C dirbuild
  134. echo "$(tput bold) ----Integration tests---- :$(tput sgr0) meson test -v --suite=igr_tests -C dirbuild"
  135. meson test -v --suite=igr_tests -C dirbuild
  136. - name: Upload igr-tests output file(s) on failure
  137. uses: actions/upload-artifact@v4.3.2
  138. if: failure()
  139. with:
  140. name: igr-tests_output
  141. path: dirbuild/src/igr-tests/*/output/*