main.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. name: CI
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. runs-on: ${{ matrix.os }}
  6. strategy:
  7. fail-fast: false
  8. matrix:
  9. # Build is segfaulting in Ubuntu.
  10. #os: [macOS-latest, windows-2016, ubuntu-16.04]
  11. os: [macOS-latest, windows-2016]
  12. platform: [x64, x86]
  13. exclude:
  14. - os: macOS-latest
  15. platform: x86
  16. # - os: ubuntu-16.04
  17. # platform: x86
  18. steps:
  19. - uses: actions/checkout@v1
  20. with:
  21. fetch-depth: 10
  22. - name: Prepare (Linux)
  23. if: matrix.os == 'ubuntu-16.04'
  24. run: |
  25. sudo apt-get install libtool-bin libtommath0 libtommath-dev libicu-dev zlib1g-dev
  26. - name: Build (Linux)
  27. if: matrix.os == 'ubuntu-16.04'
  28. run: |
  29. CC=clang CXX=clang++ ./autogen.sh --enable-binreloc --with-builtin-tomcrypt --prefix=/opt/firebird
  30. make
  31. make dist
  32. tar xzvf gen/Firebird-[0-9]*.tar.gz
  33. (cd Firebird-[0-9]*; sudo ./install.sh -silent)
  34. - name: Prepare (MacOS)
  35. if: matrix.os == 'macOS-latest'
  36. run: |
  37. brew install automake libtool
  38. export LIBTOOLIZE=glibtoolize
  39. export LIBTOOL=glibtool
  40. mkdir extern/icu-macos
  41. pushd extern/icu-macos
  42. curl -OL https://github.com/unicode-org/icu/releases/download/release-63-2/icu4c-63_2-src.tgz
  43. curl -OL https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
  44. tar xzf icu4c-63_2-src.tgz
  45. ICU_INSTALL_PATH=`pwd`/install
  46. cd icu/source
  47. patch -p3 < ../../24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
  48. ./runConfigureICU MacOSX --prefix=$ICU_INSTALL_PATH
  49. make -j4
  50. make install
  51. install_name_tool -id @rpath/lib/libicuuc.dylib $ICU_INSTALL_PATH/lib/libicuuc.dylib
  52. install_name_tool -id @rpath/lib/libicui18n.dylib $ICU_INSTALL_PATH/lib/libicui18n.dylib
  53. install_name_tool -id @rpath/lib/libicudata.dylib $ICU_INSTALL_PATH/lib/libicudata.dylib
  54. install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicuuc.63.dylib
  55. install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib
  56. install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib
  57. popd
  58. mkdir -p gen/Release/firebird/lib
  59. mkdir -p gen/Debug/firebird/lib
  60. cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/
  61. cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Debug/firebird/lib/
  62. - name: Build (MacOS)
  63. if: matrix.os == 'macOS-latest'
  64. run: |
  65. export LIBTOOLIZE=glibtoolize
  66. export LIBTOOL=glibtool
  67. ICU_INSTALL_PATH=`pwd`/extern/icu-macos/install
  68. export C_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$C_INCLUDE_PATH"
  69. export CPLUS_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$CPLUS_INCLUDE_PATH"
  70. LIBRARY_PATH="$ICU_INSTALL_PATH/lib:$LIBRARY_PATH" ./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt
  71. make -j4
  72. (cd gen; make -B -f make.platform.postfix ICU_LOC="$ICU_INSTALL_PATH/lib/")
  73. (cd gen; make -B -f Makefile.install)
  74. # Rename directory to make sure the build is relocatable.
  75. mv gen gen2
  76. sudo installer -pkg gen2/Release/*.pkg -verbose -target /
  77. export FIREBIRD_LOCK=`pwd`/temp
  78. echo "create database 't.fdb'; select '1' from rdb\$database; select _win1252 '2' from rdb\$database; select _utf8 '3' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql
  79. echo "create database 'localhost:/tmp/t.fdb' user sysdba password 'masterkey'; select '11' from rdb\$database; select _win1252 '22' from rdb\$database; select _utf8 '33' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql
  80. mv gen2 gen
  81. mkdir gen/artifacts
  82. mv gen/Release/*.pkg gen/artifacts
  83. - name: Prepare (Windows)
  84. if: matrix.os == 'windows-2016'
  85. shell: cmd
  86. run: |
  87. for /r %%i in (*.bat) do unix2dos "%%i"
  88. - name: Build (Windows)
  89. if: matrix.os == 'windows-2016'
  90. shell: cmd
  91. env:
  92. PLATFORM: ${{ matrix.platform }}
  93. run: |
  94. if "%PLATFORM%" == "x64" set FB_VS_ARCH=amd64
  95. if "%PLATFORM%" == "x64" set FB_PROCESSOR_ARCHITECTURE=AMD64
  96. if "%PLATFORM%" == "x64" set FB_OUTPUT_SUFFIX=x64
  97. if "%PLATFORM%" == "x86" set FB_VS_ARCH=x86
  98. if "%PLATFORM%" == "x86" set FB_PROCESSOR_ARCHITECTURE=x86
  99. if "%PLATFORM%" == "x86" set FB_OUTPUT_SUFFIX=win32
  100. call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=%FB_VS_ARCH%
  101. cd builds\win32
  102. run_all.bat JUSTBUILD
  103. - name: Upload (Linux)
  104. if: matrix.os == 'ubuntu-16.04'
  105. uses: actions/upload-artifact@master
  106. with:
  107. name: firebird-linux
  108. path: gen/Firebird-[0-9]*.tar.gz
  109. - name: Upload (MacOS)
  110. if: matrix.os == 'macOS-latest'
  111. uses: actions/upload-artifact@master
  112. with:
  113. name: firebird-macos
  114. path: gen/artifacts
  115. - name: Upload (Windows x64)
  116. if: matrix.os == 'windows-2016' && matrix.platform == 'x64'
  117. uses: actions/upload-artifact@master
  118. with:
  119. name: firebird-windows-x64
  120. path: output_x64
  121. - name: Upload (Windows x86)
  122. if: matrix.os == 'windows-2016' && matrix.platform == 'x86'
  123. uses: actions/upload-artifact@master
  124. with:
  125. name: firebird-windows-x86
  126. path: output_win32