main.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 -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 --build build/ --config Release
  79. - name: Configure Autotools
  80. if: runner.os == 'Linux'
  81. run: |
  82. set -eu
  83. rm -fr build-autotools
  84. mkdir build-autotools
  85. ./autogen.sh
  86. ( cd build-autotools && ../configure )
  87. curdir="$(pwd)"
  88. multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
  89. (
  90. mkdir -p build-autotools/test
  91. cd build-autotools/test
  92. ../../test/configure \
  93. --x-includes=/usr/include \
  94. --x-libraries="/usr/lib/${multiarch}" \
  95. SDL_CFLAGS="-I${curdir}/include" \
  96. SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
  97. ac_cv_lib_SDL2_ttf_TTF_Init=no \
  98. ${NULL+}
  99. )
  100. - name: Build with Autotools
  101. if: runner.os == 'Linux'
  102. run: |
  103. set -eu
  104. curdir="$(pwd)"
  105. parallel="$(getconf _NPROCESSORS_ONLN)"
  106. make -j"${parallel}" -C build-autotools
  107. make -j"${parallel}" -C build-autotools/test
  108. rm -fr DESTDIR-autotools
  109. mkdir DESTDIR-autotools
  110. make -j"${parallel}" -C build-autotools install DESTDIR="${curdir}/DESTDIR-autotools"
  111. ( cd DESTDIR-autotools; find ) | LC_ALL=C sort -u
  112. make -j"${parallel}" -C build-autotools dist