-
-
Notifications
You must be signed in to change notification settings - Fork 9
134 lines (115 loc) · 4.85 KB
/
Build-Jsonifier.yml
File metadata and controls
134 lines (115 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Jsonifier Build
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
platform:
- os: ubuntu-latest
compiler: clang
cc: clang
cxx: clang++
name: "Ubuntu Clang"
cmake_cxx: /usr/bin/clang++-20
- os: ubuntu-latest
compiler: gcc
cc: gcc
cxx: g++
name: "Ubuntu GCC"
cmake_cxx: /usr/bin/g++-14
- os: macos-latest
compiler: clang
cc: clang
cxx: clang++
name: "macOS Clang"
cmake_cxx: ""
- os: macos-latest
compiler: gcc
cc: gcc
cxx: g++
name: "macOS GCC"
cmake_cxx: ""
- os: windows-latest
compiler: msvc
name: "Windows MSVC"
cmake_cxx: ""
runs-on: ${{ matrix.platform.os }}
name: ${{ matrix.platform.name }} (${{ matrix.build_type }})
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Clang (Ubuntu)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'clang'
run: |
sudo apt-get update
sudo apt update
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 20
sudo apt-get install liburing-dev
- name: Setup GCC (Ubuntu)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'gcc'
run: |
sudo apt-get install build-essential
sudo apt-get install g++-14
sudo apt-get install liburing-dev
- name: Setup Clang (macOS)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'clang'
run: |
brew install llvm
- name: Setup GCC (macOS)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'gcc'
run: |
brew install gcc
GCC_PATH=$(brew --prefix gcc)
GCC_VER=$(ls ${GCC_PATH}/bin/gcc-* 2>/dev/null | grep -oE '[0-9]+$' | sort -rn | head -1)
echo "CC=${GCC_PATH}/bin/gcc-${GCC_VER}" >> $GITHUB_ENV
echo "CXX=${GCC_PATH}/bin/g++-${GCC_VER}" >> $GITHUB_ENV
${GCC_PATH}/bin/gcc-${GCC_VER} --version
${GCC_PATH}/bin/g++-${GCC_VER} --version
- name: Setup MSVC (Windows)
if: matrix.platform.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Create Build Directory
run: mkdir -p Build
- name: Configure CMake (Ubuntu-GCC)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'gcc'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE -DCMAKE_CXX_COMPILER=${{ matrix.platform.cmake_cxx }}
- name: Configure CMake (Ubuntu-Clang)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'clang'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE -DCMAKE_CXX_COMPILER=${{ matrix.platform.cmake_cxx }}
- name: Configure CMake (macOS-Clang)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'clang'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE
- name: Configure CMake (macOS-GCC)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'gcc'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE -DCMAKE_C_COMPILER=${{ env.CC }} -DCMAKE_CXX_COMPILER=${{ env.CXX }}
- name: Configure CMake (Windows)
if: matrix.platform.os == 'windows-latest'
run: cmake -S . -B ./Build -DJSONIFIER_BENCHMARKS=TRUE
- name: Build Project
run: cmake --build ./Build --config=${{ matrix.build_type }} -v
- name: Install Project (Unix)
if: runner.os != 'Windows'
run: sudo cmake --install ./Build --config=${{ matrix.build_type }} -v
- name: Install Project (Windows)
if: runner.os == 'Windows'
run: cmake --install ./Build --config=${{ matrix.build_type }} -v
- name: Run Benchmarks (Unix)
if: runner.os != 'Windows'
run: ./Build/Benchmarks/Json-Performance
- name: Run Benchmarks (Windows)
if: runner.os == 'Windows'
run: |
& "C:\Program Files (x86)\Jsonifier\bin\Json-Performance.exe"