main.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. name: Build
  2. on: [push, pull_request]
  3. jobs:
  4. Build:
  5. name: ${{ matrix.platform.name }}
  6. runs-on: ${{ matrix.platform.os }}
  7. defaults:
  8. run:
  9. shell: ${{ matrix.platform.shell }}
  10. strategy:
  11. fail-fast: false
  12. matrix:
  13. platform:
  14. - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
  15. - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
  16. - { name: Linux, os: ubuntu-20.04, shell: sh, flags: -GNinja }
  17. - { name: MacOS, os: macos-latest, shell: sh }
  18. steps:
  19. - name: Set up MSYS2
  20. if: matrix.platform.shell == 'msys2 {0}'
  21. uses: msys2/setup-msys2@v2
  22. with:
  23. msystem: ${{ matrix.platform.msystem }}
  24. install: >-
  25. ${{ matrix.platform.msys-env }}-gcc
  26. ${{ matrix.platform.msys-env }}-cmake
  27. ${{ matrix.platform.msys-env }}-ninja
  28. ${{ matrix.platform.msys-env }}-pkg-config
  29. - name: Setup Linux dependencies
  30. if: runner.os == 'Linux'
  31. run: |
  32. sudo apt-get update
  33. sudo apt-get install \
  34. autoconf \
  35. wayland-protocols \
  36. pkg-config \
  37. ninja-build \
  38. libasound2-dev \
  39. libdbus-1-dev \
  40. libegl1-mesa-dev \
  41. libgl1-mesa-dev \
  42. libgles2-mesa-dev \
  43. libglu1-mesa-dev \
  44. libibus-1.0-dev \
  45. libpulse-dev \
  46. libsdl2-2.0-0 \
  47. libsndio-dev \
  48. libudev-dev \
  49. libwayland-dev \
  50. libwayland-client++0 \
  51. wayland-scanner++ \
  52. libwayland-cursor++0 \
  53. libx11-dev \
  54. libxcursor-dev \
  55. libxext-dev \
  56. libxi-dev \
  57. libxinerama-dev \
  58. libxkbcommon-dev \
  59. libxrandr-dev \
  60. libxss-dev \
  61. libxt-dev \
  62. libxv-dev \
  63. libxxf86vm-dev \
  64. libdrm-dev \
  65. libgbm-dev\
  66. libpulse-dev \
  67. libpango1.0-dev
  68. sudo apt install meson
  69. git clone --depth 1 https://gitlab.gnome.org/jadahl/libdecor.git --branch 0.1.0
  70. cd libdecor
  71. meson build --buildtype release -Ddemo=false -Ddbus=disabled
  72. ninja -v -C build
  73. sudo meson install -C build
  74. - uses: actions/checkout@v2
  75. - name: Configure CMake
  76. run: cmake -B build -DSDL_TEST=ON ${{ matrix.platform.flags }}
  77. - name: Build
  78. run: cmake -v --build build/ --config Release
  79. - name: Install
  80. run: |
  81. set -eu
  82. cmake -v --build build/ --config Release
  83. rm -fr DESTDIR-cmake
  84. DESTDIR=$(pwd)/DESTDIR-cmake cmake -v --install build/ --config Release
  85. ( cd DESTDIR-cmake; find ) | LC_ALL=C sort -u
  86. - name: Configure Autotools
  87. if: runner.os == 'Linux'
  88. run: |
  89. set -eu
  90. rm -fr build-autotools
  91. mkdir build-autotools
  92. ./autogen.sh
  93. ( cd build-autotools && ../configure )
  94. curdir="$(pwd)"
  95. multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
  96. (
  97. mkdir -p build-autotools/test
  98. cd build-autotools/test
  99. ../../test/configure \
  100. --x-includes=/usr/include \
  101. --x-libraries="/usr/lib/${multiarch}" \
  102. SDL_CFLAGS="-I${curdir}/include" \
  103. SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
  104. ac_cv_lib_SDL2_ttf_TTF_Init=no \
  105. ${NULL+}
  106. )
  107. - name: Build with Autotools
  108. if: runner.os == 'Linux'
  109. run: |
  110. set -eu
  111. curdir="$(pwd)"
  112. parallel="$(getconf _NPROCESSORS_ONLN)"
  113. make -j"${parallel}" -C build-autotools V=1
  114. make -j"${parallel}" -C build-autotools/test V=1
  115. rm -fr DESTDIR-autotools
  116. mkdir DESTDIR-autotools
  117. make -j"${parallel}" -C build-autotools install DESTDIR="${curdir}/DESTDIR-autotools" V=1
  118. ( cd DESTDIR-autotools; find ) | LC_ALL=C sort -u
  119. make -j"${parallel}" -C build-autotools dist V=1