build.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. name: "Build & Test"
  2. on: [push, pull_request]
  3. jobs:
  4. macOS:
  5. runs-on: macos-latest
  6. timeout-minutes: 30
  7. env:
  8. MACOSX_DEPLOYMENT_TARGET: "10.9"
  9. steps:
  10. - name: Checkout
  11. uses: actions/checkout@v3
  12. - name: Install Lua 5.1
  13. uses: leafo/[email protected]
  14. with:
  15. luaVersion: "5.1.5"
  16. - name: Configure
  17. run: cmake -Bbuild -S. -G Xcode -DLUA_INCLUDE_DIR=$PWD/.lua/include -DLUA_LIBRARIES=$PWD/.lua/lib/liblua.a
  18. - name: Build
  19. working-directory: build
  20. run: xcodebuild -configuration Release -scheme https
  21. - name: Test
  22. working-directory: ./build/src/Release
  23. run: lua -l "https" ../../../example/test.lua
  24. - name: Artifact
  25. if: always()
  26. uses: actions/upload-artifact@v3
  27. with:
  28. name: https-macos.zip
  29. path: build/src/**/https.so
  30. Linux:
  31. name: ${{ matrix.mode.name }}
  32. runs-on: ubuntu-latest
  33. timeout-minutes: 30
  34. strategy:
  35. matrix:
  36. mode:
  37. - name: Linux cURL
  38. curl: 1
  39. openssl: 0
  40. artifact: 0
  41. - name: Linux OpenSSL
  42. curl: 0
  43. openssl: 1
  44. artifact: 0
  45. - name: Linux cURL & OpenSSL
  46. curl: 1
  47. openssl: 1
  48. artifact: 1
  49. steps:
  50. - name: Checkout
  51. uses: actions/checkout@v3
  52. - name: Update APT Repository
  53. run: sudo apt-get update
  54. - name: Install Dependencies
  55. run: sudo apt-get install -y lua5.1 luajit liblua5.1-0-dev libcurl4-openssl-dev g++ libssl-dev
  56. - name: Configure
  57. run: cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Release -DUSE_CURL_BACKEND=${{ matrix.mode.curl }} -DUSE_OPENSSL_BACKEND=${{ matrix.mode.openssl }}
  58. - name: Build
  59. run: cmake --build build --config Release --target install -j$(nproc)
  60. - name: Test (Lua)
  61. if: matrix.mode.artifact == 0
  62. working-directory: ./install
  63. run: lua -l "https" ../example/test.lua
  64. - name: Test (LuaJIT)
  65. if: matrix.mode.artifact == 0
  66. working-directory: ./install
  67. run: luajit -l "https" ../example/test.lua
  68. - name: Artifact
  69. if: matrix.mode.artifact == 1
  70. uses: actions/upload-artifact@v3
  71. with:
  72. name: https-ubuntu.zip
  73. path: install/https.so
  74. Windows:
  75. runs-on: windows-latest
  76. strategy:
  77. matrix:
  78. arch:
  79. - Win32
  80. - x64
  81. defaults:
  82. run:
  83. shell: cmd
  84. steps:
  85. - name: Checkout
  86. uses: actions/checkout@v3
  87. - name: Download LuaJIT
  88. uses: actions/checkout@v3
  89. with:
  90. repository: LuaJIT/LuaJIT
  91. ref: v2.1
  92. path: LuaJIT
  93. - name: Configure MSVC Developer Command Prompt
  94. uses: ilammy/msvc-dev-cmd@v1
  95. with:
  96. arch: ${{ matrix.arch }}
  97. - name: Compile LuaJIT
  98. working-directory: ./LuaJIT/src
  99. run: msvcbuild.bat amalg
  100. - name: Configure
  101. run: cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=%CD%\install -A ${{ matrix.arch }} -DLUA_INCLUDE_DIR=%CD%\LuaJIT\src -DLUA_LIBRARIES=%CD%\LuaJIT\src\lua51.lib
  102. - name: Build
  103. run: cmake --build build --config Release --target install
  104. - name: Test
  105. working-directory: ./install
  106. run: ..\LuaJIT\src\luajit ..\example\test.lua
  107. - name: Artifact
  108. if: always()
  109. uses: actions/upload-artifact@v3
  110. with:
  111. name: https-windows-${{ matrix.arch }}.zip
  112. path: install/https.dll