test.yaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: test
  2. on: [push, pull_request]
  3. jobs:
  4. ubuntu:
  5. runs-on: ubuntu-latest
  6. if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
  7. steps:
  8. - name: checkout
  9. uses: actions/checkout@v4
  10. - name: install libraries
  11. run: sudo apt-get update && sudo apt-get install -y libbrotli-dev libcurl4-openssl-dev
  12. - name: build and run tests
  13. run: cd test && make
  14. - name: run fuzz test target
  15. run: cd test && make fuzz_test
  16. macos:
  17. runs-on: macos-latest
  18. if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
  19. steps:
  20. - name: checkout
  21. uses: actions/checkout@v4
  22. - name: build and run tests
  23. run: cd test && make
  24. - name: run fuzz test target
  25. run: cd test && make fuzz_test
  26. windows:
  27. runs-on: windows-latest
  28. if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
  29. steps:
  30. - name: Prepare Git for Checkout on Windows
  31. run: |
  32. git config --global core.autocrlf false
  33. git config --global core.eol lf
  34. - name: Checkout
  35. uses: actions/checkout@v4
  36. - name: Export GitHub Actions cache environment variables
  37. uses: actions/github-script@v7
  38. with:
  39. script: |
  40. core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
  41. core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
  42. - name: Setup msbuild on windows
  43. uses: microsoft/setup-msbuild@v2
  44. - name: Install libraries
  45. run: |
  46. vcpkg install gtest curl zlib brotli
  47. choco install openssl
  48. - name: Configure CMake with SSL
  49. run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DHTTPLIB_TEST=ON -DHTTPLIB_REQUIRE_OPENSSL=ON -DHTTPLIB_REQUIRE_ZLIB=ON -DHTTPLIB_REQUIRE_BROTLI=ON
  50. - name: Build with with SSL
  51. run: cmake --build build --config Release
  52. - name: Run tests with SSL
  53. run: ctest --output-on-failure --test-dir build -C Release
  54. - name: Configure CMake without SSL
  55. run: cmake -B build-no-ssl -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DHTTPLIB_TEST=ON -DHTTPLIB_REQUIRE_OPENSSL=OFF -DHTTPLIB_REQUIRE_ZLIB=ON -DHTTPLIB_REQUIRE_BROTLI=ON
  56. - name: Build without SSL
  57. run: cmake --build build-no-ssl --config Release
  58. - name: Run tests without SSL
  59. run: ctest --output-on-failure --test-dir build-no-ssl -C Release
  60. env:
  61. VCPKG_ROOT: "C:/vcpkg"
  62. VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"