http::server: include required headers #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMake on Linux, macOS, and Windows | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| c_compiler: gcc | |
| cpp_compiler: g++ | |
| build_type: Release | |
| - os: macos-latest | |
| c_compiler: clang | |
| cpp_compiler: clang++ | |
| build_type: Release | |
| - os: windows-latest | |
| c_compiler: cl | |
| cpp_compiler: cl | |
| build_type: Release | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install OpenSSL | |
| run: | | |
| if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
| sudo apt update | |
| sudo apt install -y libssl-dev | |
| echo "CMAKE_PREFIX_PATH=/usr" >> $GITHUB_ENV | |
| elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
| brew update | |
| brew install openssl | |
| OPENSSL_DIR=$(brew --prefix openssl) | |
| echo "CMAKE_PREFIX_PATH=${OPENSSL_DIR}" >> $GITHUB_ENV | |
| elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
| choco install openssl.light -y | |
| echo "CMAKE_PREFIX_PATH=C:/Program Files/OpenSSL-Win64" >> $GITHUB_ENV | |
| fi | |
| shell: bash | |
| - name: Set reusable strings | |
| id: strings | |
| shell: bash | |
| run: | | |
| echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
| - name: Configure CMake | |
| run: > | |
| cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
| -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DCMAKE_PREFIX_PATH=${{ env.CMAKE_PREFIX_PATH }} | |
| -S ${{ github.workspace }} | |
| - name: Build | |
| run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
| - name: Test | |
| working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
| run: ctest --build-config ${{ matrix.build_type }} |