Tweak CI & fix macOS prefix (#1843)

* Use brew prefix or given one

* Polish CI workflow file
This commit is contained in:
Vladimír Chlup 2024-05-26 14:24:29 +02:00 committed by GitHub
parent 05f9f83240
commit 25b1e0d906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 22 deletions

View file

@ -3,39 +3,41 @@ name: test
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build: ubuntu:
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: install brotli
run: sudo apt-get update && sudo apt-get install -y libbrotli-dev
- name: build and run tests
run: cd test && make -j4
- name: run fuzz test target
run: cd test && make fuzz_test
strategy: macos:
matrix: runs-on: macos-latest
os: [macOS-latest, ubuntu-latest, windows-latest] steps:
- name: checkout
uses: actions/checkout@v4
- name: build and run tests
run: |
cd test && make -j2
windows:
runs-on: windows-latest
steps: steps:
- name: prepare git for checkout on windows - name: prepare git for checkout on windows
if: matrix.os == 'windows-latest'
run: | run: |
git config --global core.autocrlf false git config --global core.autocrlf false
git config --global core.eol lf git config --global core.eol lf
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- 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 - name: setup msbuild on windows
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v2
- name: make-windows - name: make-windows
if: matrix.os == 'windows-latest'
run: | run: |
cd test cd test
msbuild.exe test.sln /verbosity:minimal /t:Build "/p:Configuration=Release;Platform=x64" msbuild.exe test.sln /verbosity:minimal /t:Build "/p:Configuration=Release;Platform=x64"
x64\Release\test.exe x64\Release\test.exe

View file

@ -1,8 +1,7 @@
CXX = clang++ CXX = clang++
CXXFLAGS = -g -std=c++11 -I. -Wall -Wextra -Wtype-limits -Wconversion -Wshadow # -fno-exceptions -DCPPHTTPLIB_NO_EXCEPTIONS -fsanitize=address CXXFLAGS = -g -std=c++11 -I. -Wall -Wextra -Wtype-limits -Wconversion -Wshadow # -fno-exceptions -DCPPHTTPLIB_NO_EXCEPTIONS -fsanitize=address
PREFIX = /usr/local PREFIX ?= $(shell brew --prefix)
#PREFIX = $(shell brew --prefix)
OPENSSL_DIR = $(PREFIX)/opt/openssl@3 OPENSSL_DIR = $(PREFIX)/opt/openssl@3
OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib -lssl -lcrypto OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib -lssl -lcrypto