build.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: build
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. runs-on: ${{ matrix.os }}
  6. strategy:
  7. matrix:
  8. os: [ubuntu-22.04, macos-11]
  9. compiler: [gcc, clang]
  10. steps:
  11. - uses: actions/checkout@v3
  12. - name: Linux setup
  13. if: runner.os == 'Linux'
  14. run: |
  15. sudo apt-get install \
  16. g++-11 \
  17. clang-12 \
  18. autoconf \
  19. automake \
  20. autotools-dev \
  21. autopoint \
  22. libtool \
  23. pkg-config \
  24. libssl-dev \
  25. libc-ares-dev \
  26. zlib1g-dev \
  27. libsqlite3-dev \
  28. libssh2-1-dev \
  29. libcppunit-dev
  30. - name: MacOS setup
  31. if: runner.os == 'macOS'
  32. run: |
  33. brew install cppunit gettext openssl libssh2 c-ares sqlite3 \
  34. autoconf automake pkg-config libtool
  35. - name: Setup clang (Linux)
  36. if: runner.os == 'Linux' && matrix.compiler == 'clang'
  37. run: |
  38. echo 'CC=clang-12' >> $GITHUB_ENV
  39. echo 'CXX=clang++-12' >> $GITHUB_ENV
  40. - name: Setup clang (MacOS)
  41. if: runner.os == 'macOS' && matrix.compiler == 'clang'
  42. run: |
  43. echo 'CC=clang' >> $GITHUB_ENV
  44. echo 'CXX=clang++' >> $GITHUB_ENV
  45. - name: Setup gcc (Linux)
  46. if: runner.os == 'Linux' && matrix.compiler == 'gcc'
  47. run: |
  48. echo 'CC=gcc-11' >> $GITHUB_ENV
  49. echo 'CXX=g++-11' >> $GITHUB_ENV
  50. - name: Setup gcc (MacOS)
  51. if: runner.os == 'macOS' && matrix.compiler == 'gcc'
  52. run: |
  53. echo 'CC=gcc' >> $GITHUB_ENV
  54. echo 'CXX=g++' >> $GITHUB_ENV
  55. - name: Libtool
  56. run: |
  57. autoreconf -i
  58. - name: Configure autotools (Linux)
  59. if: runner.os == 'Linux'
  60. run: |
  61. ./configure \
  62. CPPFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address"
  63. - name: Configure autotools (macOS)
  64. if: runner.os == 'macOS'
  65. run: |
  66. ./configure \
  67. --without-openssl --without-gnutls --with-appletls \
  68. --disable-nls \
  69. CPPFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address"
  70. - name: Build aria2
  71. run: |
  72. make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" check