This repository was archived by the owner on Sep 22, 2025. It is now read-only.
Pin GitHub actions to commit hashes for security\n\nPinned 5 actions … #1
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: test | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macOS-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - name: prepare git for checkout on windows | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - name: checkout | |
| uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
| - name: install brotli library on ubuntu | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt update && sudo apt-get install -y libbrotli-dev | |
| - name: install brotli library on macOS | |
| if: matrix.os == 'macOS-latest' | |
| run: brew install brotli | |
| - name: make | |
| if: matrix.os != 'windows-latest' | |
| run: cd test && make -j2 | |
| - name: check fuzz test target | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cd test && make fuzz_test | |
| - name: setup msbuild on windows | |
| if: matrix.os == 'windows-latest' | |
| uses: microsoft/setup-msbuild@c26a08ba26249b81327e26f6ef381897b6a8754d # v1.0.2 | |
| - name: make-windows | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| cd test | |
| msbuild.exe test.sln /verbosity:minimal /t:Build "/p:Configuration=Release;Platform=x64" | |
| x64\Release\test.exe | |
| meson-build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Prepare Git for checkout on Windows | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
| - name: Install dependencies on Linux | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get -qq update && sudo apt-get -qq install meson libssl-dev zlib1g-dev libbrotli-dev libgtest-dev | |
| - name: Install dependencies on MacOS | |
| if: matrix.os == 'macos-latest' | |
| run: brew install meson openssl brotli googletest | |
| - name: Setup MSVC on Windows | |
| if: matrix.os == 'windows-latest' | |
| uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | |
| # It is necessary to remove MinGW and StrawberryPerl as they both provide | |
| # GCC. This causes issues because CMake prefers to use MSVC, while Meson | |
| # uses GCC, if found, causing linking errors. | |
| - name: Install dependencies on Windows | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| choco uninstall mingw strawberryperl --yes --all-versions --remove-dependencies --skip-autouninstaller --no-color | |
| Remove-Item -Path C:\Strawberry -Recurse | |
| choco install pkgconfiglite --yes --skip-virus-check --no-color | |
| pip install meson ninja | |
| Invoke-WebRequest -Uri https://github.com/google/googletest/archive/refs/heads/master.zip -OutFile googletest-master.zip | |
| Expand-Archive -Path googletest-master.zip | |
| cd googletest-master\googletest-master | |
| cmake -S . -B build -DINSTALL_GTEST=ON -DBUILD_GMOCK=OFF -Dgtest_hide_internal_symbols=ON -DCMAKE_INSTALL_PREFIX=C:/googletest | |
| cmake --build build --config=Release | |
| cmake --install build --config=Release | |
| cd ..\.. | |
| - name: Build and test | |
| run: | | |
| meson setup build -Dcpp-httplib_test=true -Dpkg_config_path=C:\googletest\lib\pkgconfig -Db_vscrt=static_from_buildtype | |
| meson test --no-stdsplit --print-errorlogs -C build |