.gitlab-ci.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. image: debian:stable-slim
  2. stages:
  3. - build
  4. - test
  5. before_script:
  6. - test ! -r /etc/debian_version || apt-get -qq update
  7. - test ! -r /etc/debian_version || apt-get install -y git debhelper dpkg-dev build-essential fakeroot flawfinder wget unzip
  8. - test ! -r /etc/debian_version || apt-get install -y libpcap-dev libselinux1-dev
  9. - test ! -r /etc/debian_version || apt-get install -y binutils-mingw-w64-i686 gcc-mingw-w64 mingw-w64-i686-dev mingw-w64-common clang
  10. - test ! -r /etc/debian_version || apt-get install -y valgrind sudo netcat-openbsd
  11. - test ! -r /etc/debian_version || apt-get install -y autoconf automake dh-autoreconf
  12. - test ! -r /etc/arch-release || pacman -Syu --noconfirm
  13. - test ! -r /etc/arch-release || pacman -S --noconfirm binutils gcc base-devel git
  14. - test ! -r /etc/arch-release || pacman -S --noconfirm valgrind sudo
  15. - mkdir -p ./deploy/gcc ./deploy/i686-w64-mingw32-winpcap ./deploy/i686-w64-mingw32-npcap ./deploy/clang ./deploy/android28-clang
  16. build:
  17. script:
  18. - autoreconf -fi
  19. - ./configure --enable-option-checking=fatal --prefix=/
  20. - mv config.log deploy/config-default.log
  21. - make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/gcc)" V=s
  22. - make dist
  23. - cp ptunnel-ng-*.tar.gz ./deploy/
  24. stage: build
  25. artifacts:
  26. paths:
  27. - deploy/
  28. when: always
  29. build-sanitizer-asserts:
  30. script:
  31. - autoreconf -fi
  32. - ./configure --enable-option-checking=fatal --prefix=/ --enable-sanitizer --enable-asserts
  33. - mv config.log deploy/config-sanitizer-assert.log
  34. - make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/gcc-sanitizer-asserts)" V=s
  35. stage: build
  36. artifacts:
  37. paths:
  38. - deploy/
  39. when: always
  40. build-debian:
  41. script:
  42. - dpkg-buildpackage -b -us -uc
  43. - mv config.log deploy/config-debian.log
  44. - ls -alh ..
  45. - mkdir -p deploy/debian
  46. - mv -v ../ptunnel-ng-dbgsym_* ../ptunnel-ng_* deploy/debian/
  47. stage: build
  48. artifacts:
  49. paths:
  50. - deploy/
  51. when: always
  52. build-archlinux:
  53. image: archlinux:latest
  54. script:
  55. - useradd builduser -m
  56. - passwd -d builduser
  57. - chown -R builduser .
  58. - su -m builduser bash -c 'makepkg'
  59. - su -m builduser bash -c 'makepkg -p PKGBUILD.dev --skipchecksums'
  60. - ls -alh .
  61. - mkdir deploy/archlinux
  62. - mv -v ptunnel-ng-*.tar.xz deploy/archlinux/
  63. stage: build
  64. artifacts:
  65. paths:
  66. - deploy/
  67. when: always
  68. build-mingw:
  69. script:
  70. - autoreconf -fi
  71. - ./configure --enable-option-checking=fatal --prefix=/ --host=i686-w64-mingw32
  72. - mv config.log deploy/config-mingw-i686.log
  73. - make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/i686-w64-mingw32-winpcap)" V=s
  74. - ./configure --enable-option-checking=fatal --prefix=/ --host=i686-w64-mingw32 --enable-npcap
  75. - mv config.log deploy/config-mingw-i686-npcap.log
  76. - make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/i686-w64-mingw32-npcap)" V=s
  77. stage: build
  78. artifacts:
  79. paths:
  80. - deploy/
  81. when: always
  82. build-clang:
  83. script:
  84. - autoreconf -fi
  85. - CC=clang ./configure --enable-option-checking=fatal --prefix=/
  86. - mv config.log deploy/config-clang.log
  87. - make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/clang)" V=s
  88. stage: build
  89. artifacts:
  90. paths:
  91. - deploy/
  92. when: always
  93. build-android:
  94. cache:
  95. key: toolchain-cache
  96. paths:
  97. - vendor/
  98. script:
  99. - mkdir -p vendor && cd vendor
  100. - test -r 'android-ndk-r19-linux-x86_64.zip' || wget --progress=dot:mega 'https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip'
  101. - test -d 'android-ndk-r19' || unzip -q 'android-ndk-r19-linux-x86_64.zip'
  102. - cd ..
  103. - autoreconf -fi
  104. - CC=aarch64-linux-android28-clang PATH="${PATH}:$(realpath ./vendor/android-ndk-r19/toolchains/llvm/prebuilt/linux-x86_64/bin)" ./configure --enable-option-checking=fatal --host=aarch64-linux-android
  105. - mv config.log deploy/config-aarch64-linux-android28-clang.log
  106. - PATH="${PATH}:$(realpath ./vendor/android-ndk-r19/toolchains/llvm/prebuilt/linux-x86_64/bin)" make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/android28-clang)" V=s
  107. stage: build
  108. artifacts:
  109. paths:
  110. - deploy/
  111. when: always
  112. test-valgrind:
  113. script:
  114. - ls -alhR .
  115. - deploy/gcc/bin/ptunnel-ng --help
  116. - PTUNNEL_BIN="deploy/gcc/bin/ptunnel-ng" test/integration_test.sh
  117. - mv /tmp/ptunnel-client.log ptunnel-client-valgrind.log
  118. - mv /tmp/ptunnel-server.log ptunnel-server-valgrind.log
  119. stage: test
  120. artifacts:
  121. paths:
  122. - deploy/
  123. - ptunnel-client-valgrind.log
  124. - ptunnel-server-valgrind.log
  125. when: always
  126. test-asan:
  127. script:
  128. - ls -alhR .
  129. - deploy/gcc-sanitizer-asserts/bin/ptunnel-ng --help
  130. - export DISABLE_VALGRIND=y && export PTUNNEL_BIN="deploy/gcc-sanitizer-asserts/bin/ptunnel-ng" && test/integration_test.sh
  131. - mv /tmp/ptunnel-client.log ptunnel-client-sanitizer.log
  132. - mv /tmp/ptunnel-server.log ptunnel-server-sanitizer.log
  133. - export DISABLE_VALGRIND=y && export PTUNNEL_BIN="deploy/gcc-sanitizer-asserts/bin/ptunnel-ng" && export PTUNNEL_ARGS="--passwd=ci" && test/integration_test.sh
  134. - mv /tmp/ptunnel-client.log ptunnel-client-sanitizer-passwd.log
  135. - mv /tmp/ptunnel-server.log ptunnel-server-sanitizer-passwd.log
  136. stage: test
  137. artifacts:
  138. paths:
  139. - deploy/
  140. - ptunnel-client-sanitizer.log
  141. - ptunnel-server-sanitizer.log
  142. - ptunnel-client-sanitizer-passwd.log
  143. - ptunnel-server-sanitizer-passwd.log
  144. when: always