Skip to content

Commit 25b1e0d

Browse files
authored
Tweak CI & fix macOS prefix (yhirose#1843)
* Use brew prefix or given one * Polish CI workflow file
1 parent 05f9f83 commit 25b1e0d

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,41 @@ name: test
33
on: [push, pull_request]
44

55
jobs:
6-
build:
7-
runs-on: ${{ matrix.os }}
6+
ubuntu:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: checkout
10+
uses: actions/checkout@v4
11+
- name: install brotli
12+
run: sudo apt-get update && sudo apt-get install -y libbrotli-dev
13+
- name: build and run tests
14+
run: cd test && make -j4
15+
- name: run fuzz test target
16+
run: cd test && make fuzz_test
817

9-
strategy:
10-
matrix:
11-
os: [macOS-latest, ubuntu-latest, windows-latest]
18+
macos:
19+
runs-on: macos-latest
20+
steps:
21+
- name: checkout
22+
uses: actions/checkout@v4
23+
- name: build and run tests
24+
run: |
25+
cd test && make -j2
1226
27+
windows:
28+
runs-on: windows-latest
1329
steps:
1430
- name: prepare git for checkout on windows
15-
if: matrix.os == 'windows-latest'
1631
run: |
1732
git config --global core.autocrlf false
1833
git config --global core.eol lf
1934
- name: checkout
2035
uses: actions/checkout@v4
21-
- name: install brotli library on ubuntu
22-
if: matrix.os == 'ubuntu-latest'
23-
run: sudo apt update && sudo apt-get install -y libbrotli-dev
24-
- name: install brotli library on macOS
25-
if: matrix.os == 'macOS-latest'
26-
run: brew install brotli
27-
- name: make
28-
if: matrix.os != 'windows-latest'
29-
run: cd test && make -j2
30-
- name: check fuzz test target
31-
if: matrix.os == 'ubuntu-latest'
32-
run: cd test && make fuzz_test
3336
- name: setup msbuild on windows
34-
if: matrix.os == 'windows-latest'
3537
uses: microsoft/setup-msbuild@v2
3638
- name: make-windows
37-
if: matrix.os == 'windows-latest'
3839
run: |
3940
cd test
4041
msbuild.exe test.sln /verbosity:minimal /t:Build "/p:Configuration=Release;Platform=x64"
4142
x64\Release\test.exe
43+

test/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
CXX = clang++
22
CXXFLAGS = -g -std=c++11 -I. -Wall -Wextra -Wtype-limits -Wconversion -Wshadow # -fno-exceptions -DCPPHTTPLIB_NO_EXCEPTIONS -fsanitize=address
33

4-
PREFIX = /usr/local
5-
#PREFIX = $(shell brew --prefix)
4+
PREFIX ?= $(shell brew --prefix)
65

76
OPENSSL_DIR = $(PREFIX)/opt/openssl@3
87
OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I$(OPENSSL_DIR)/include -L$(OPENSSL_DIR)/lib -lssl -lcrypto

0 commit comments

Comments
 (0)