Skip to content

Commit e2cf874

Browse files
authored
Merge pull request #22 from bbalouki/bbs-dev
update workflow
2 parents 30e79b9 + 2698a74 commit e2cf874

File tree

5 files changed

+24
-131
lines changed

5 files changed

+24
-131
lines changed
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: Linux
1+
name: Build
22

33
on:
44
push:
55
branches: [ "main" ]
66

77
jobs:
88
build-and-test:
9-
runs-on: ubuntu-latest
109
strategy:
1110
fail-fast: false
1211
matrix:
12+
os: [ubuntu-latest, windows-latest, macos-latest]
1313
build_type: [Release, Debug]
1414
cpp_standard: [20, 23]
15+
runs-on: ${{ matrix.os }}
1516
env:
1617
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
1718
BUILD_DIR: ${{ github.workspace }}/build
@@ -41,6 +42,21 @@ jobs:
4142
key: ${{ runner.os }}-${{ matrix.build_type }}-cmake-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt') }}
4243
restore-keys: |
4344
${{ runner.os }}-${{ matrix.build_type }}-cmake-
45+
46+
- name: Set VCPKG Triplet
47+
shell: bash
48+
run: |
49+
if [ "$RUNNER_OS" == "Windows" ]; then
50+
echo "VCPKG_TARGET_TRIPLET=x64-windows" >> $GITHUB_ENV
51+
elif [ "$RUNNER_OS" == "Linux" ]; then
52+
echo "VCPKG_TARGET_TRIPLET=x64-linux" >> $GITHUB_ENV
53+
else
54+
if [ "$(uname -m)" == "arm64" ]; then
55+
echo "VCPKG_TARGET_TRIPLET=arm64-osx" >> $GITHUB_ENV
56+
else
57+
echo "VCPKG_TARGET_TRIPLET=x64-osx" >> $GITHUB_ENV
58+
fi
59+
fi
4460
4561
- name: Configure CMake
4662
shell: bash
@@ -51,7 +67,7 @@ jobs:
5167
-DITCH_CXX_STANDARD=${{ matrix.cpp_standard }} \
5268
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
5369
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
54-
-DVCPKG_TARGET_TRIPLET=x64-linux
70+
-DVCPKG_TARGET_TRIPLET=$VCPKG_TARGET_TRIPLET
5571
5672
- name: Build
5773
shell: bash

.github/workflows/macos.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/windows.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11

22
# High-Performance NASDAQ ITCH 5.0 Parser
33

4-
[![Linux](https://github.com/bbalouki/itchcpp/actions/workflows/linux.yml/badge.svg)](https://github.com/bbalouki/itchcpp/actions/workflows/linux.yml)
5-
[![macOS](https://github.com/bbalouki/itchcpp/actions/workflows/macos.yml/badge.svg)](https://github.com/bbalouki/itchcpp/actions/workflows/macos.yml)
6-
[![Windows](https://github.com/bbalouki/itchcpp/actions/workflows/windows.yml/badge.svg)](https://github.com/bbalouki/itchcpp/actions/workflows/windows.yml)
4+
[![Build](https://github.com/bbalouki/itchcpp/actions/workflows/build.yml/badge.svg)](https://github.com/bbalouki/itchcpp/actions/workflows/build.yml)
5+
![Linux](https://img.shields.io/badge/Linux-FCC624?logo=linux&logoColor=black)
6+
![macOS](https://img.shields.io/badge/macOS-000000?logo=apple&logoColor=white)
7+
![Windows](https://img.shields.io/badge/Windows-0078D6?logo=windows&logoColor=white)
78
[![C++20](https://img.shields.io/badge/C++-20-blue.svg)](https://isocpp.org/std/the-standard)
89
[![CMake](https://img.shields.io/badge/CMake-3.20+-blue.svg)](https://cmake.org/)
910
[![CodeFactor](https://www.codefactor.io/repository/github/bbalouki/itchcpp/badge)](https://www.codefactor.io/repository/github/bbalouki/itchcpp)

cmake/Helpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function(apply_formating USE_PER_FILE_LOGIC)
183183
foreach(file ${ALL_FILES})
184184
add_custom_command(
185185
TARGET format
186-
POST_BUILD
186+
PRE_BUILD
187187
COMMAND ${CLANG_FORMAT_EXE} -i "${file}"
188188
COMMENT "Formatting ${file}"
189189
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}

0 commit comments

Comments
 (0)