macos.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: macos
  2. # build on c/cpp changes or workflow changes
  3. on:
  4. push:
  5. paths:
  6. - 'lib/**.[ch]'
  7. - 'lib/**.cpp'
  8. - 'src/**.[ch]'
  9. - 'src/**.cpp'
  10. - '**/CMakeLists.txt'
  11. - 'cmake/Modules/**'
  12. - '.github/workflows/macos.yml'
  13. pull_request:
  14. paths:
  15. - 'lib/**.[ch]'
  16. - 'lib/**.cpp'
  17. - 'src/**.[ch]'
  18. - 'src/**.cpp'
  19. - '**/CMakeLists.txt'
  20. - 'cmake/Modules/**'
  21. - '.github/workflows/macos.yml'
  22. env:
  23. IRRLICHT_TAG: 1.9.0mt4
  24. MINETEST_GAME_REPO: https://github.com/minetest/minetest_game.git
  25. MINETEST_GAME_BRANCH: master
  26. MINETEST_GAME_NAME: minetest_game
  27. jobs:
  28. build:
  29. runs-on: macos-10.15
  30. steps:
  31. - uses: actions/checkout@v2
  32. - name: Install deps
  33. run: |
  34. pkgs=(cmake freetype gettext gmp hiredis jpeg jsoncpp leveldb libogg libpng libvorbis luajit zstd)
  35. brew update
  36. brew install ${pkgs[@]}
  37. brew unlink $(brew ls --formula)
  38. brew link ${pkgs[@]}
  39. - name: Build
  40. run: |
  41. git clone -b $MINETEST_GAME_BRANCH $MINETEST_GAME_REPO games/$MINETEST_GAME_NAME
  42. rm -rvf games/$MINETEST_GAME_NAME/.git
  43. git clone https://github.com/minetest/irrlicht -b $IRRLICHT_TAG lib/irrlichtmt
  44. mkdir build
  45. cd build
  46. cmake .. \
  47. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
  48. -DCMAKE_FIND_FRAMEWORK=LAST \
  49. -DCMAKE_INSTALL_PREFIX=../build/macos/ \
  50. -DRUN_IN_PLACE=FALSE \
  51. -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=TRUE
  52. make -j2
  53. make install
  54. - name: Test
  55. run: |
  56. ./build/macos/minetest.app/Contents/MacOS/minetest --run-unittests
  57. - uses: actions/upload-artifact@v2
  58. with:
  59. name: minetest-macos
  60. path: ./build/macos/