| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | paths-ignore: |
| 6 | - '**.md' |
| 7 | |
| 8 | pull_request: |
| 9 | paths-ignore: |
| 10 | - '**.md' |
| 11 | |
| 12 | jobs: |
| 13 | build-linux: |
| 14 | name: build-linux |
| 15 | runs-on: ubuntu-latest |
| 16 | steps: |
| 17 | - uses: actions/checkout@v3 |
| 18 | |
| 19 | - name: build |
| 20 | run: | |
| 21 | sudo apt update |
| 22 | sudo apt install libssl-dev libnghttp2-dev |
| 23 | ./configure --with-openssl --with-nghttp2 --with-kcp --with-mqtt |
| 24 | make libhv evpp |
| 25 | |
| 26 | - name: test |
| 27 | run: | |
| 28 | make check |
| 29 | make run-unittest |
| 30 | |
| 31 | build-windows: |
| 32 | name: build-windows |
| 33 | runs-on: windows-latest |
| 34 | steps: |
| 35 | - uses: actions/checkout@v3 |
| 36 | - name: build |
| 37 | run: | |
| 38 | mkdir cmake-build-win64 |
| 39 | cd cmake-build-win64 |
| 40 | cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release |
| 41 | cmake --build . --config Release |
| 42 | cd .. |
| 43 | |
| 44 | - name: test |
| 45 | run: | |
| 46 | cd cmake-build-win64 |
| 47 | start bin/Release/http_server_test |
| 48 | bin/Release/http_client_test |
| 49 | bin/Release/curl -v -X HEAD http://example.com/ |
| 50 | bin/Release/curl -v -X HEAD https://example.com/ |
| 51 | bin/Release/wrk -c 100 -t 2 -d 10s http://127.0.0.1:8080/ping |
| 52 | |
| 53 | build-mac: |
| 54 | name: build-mac |
| 55 | runs-on: macos-latest |
| 56 | steps: |
| 57 | - uses: actions/checkout@v3 |
| 58 | - name: build |
| 59 | run: | |
| 60 | ./configure |
| 61 | make libhv evpp examples unittest |
| 62 | |
| 63 | - name: test |
| 64 | run: | |
| 65 | bin/curl -v -X HEAD http://example.com/ |
| 66 | bin/curl -v -X HEAD https://example.com/ |
| 67 | |
| 68 | build-android: |
| 69 | name: build-android |
| 70 | runs-on: ubuntu-latest |
| 71 | steps: |
| 72 | - uses: actions/checkout@v3 |
| 73 | - name: build |
| 74 | run: | |
| 75 | mkdir cmake-build-arm64 |
| 76 | cd cmake-build-arm64 |
| 77 | cmake .. -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 |
| 78 | cmake --build . --target hv --config Release |
| 79 | |
| 80 | build-ios: |
| 81 | name: build-ios |
| 82 | runs-on: macos-latest |
| 83 | steps: |
| 84 | - uses: actions/checkout@v3 |
| 85 | - name: build |
| 86 | run: | |
| 87 | mkdir cmake-build-ios |
| 88 | cd cmake-build-ios |
| 89 | cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" -DDEPLOYMENT_TARGET=9.0 |
| 90 | cmake --build . --target hv_static --config Release |