Skip to content

Commit 172db55

Browse files
authored
Fix CI pipelines (#3)
* Fix trigger branch name for integration * Will ubuntu runner work with current conf? * Remove shell reference * Trying to fix integration * Update Main.cpp * C++17
1 parent da5dca0 commit 172db55

File tree

8 files changed

+29
-11
lines changed

8 files changed

+29
-11
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ env:
1212

1313
jobs:
1414
build:
15-
runs-on: windows-2022
15+
strategy:
16+
matrix:
17+
os: [ ubuntu-latest, windows-2022 ]
18+
runs-on: ${{ matrix.os }}
1619

1720
steps:
1821
- uses: actions/checkout@v4
@@ -25,15 +28,12 @@ jobs:
2528
mkdir "${{ env.BUILD_DIR }}"
2629
cd "${{ env.BUILD_DIR }}"
2730
cmake ..
28-
shell: cmd
2931
3032
- name: Build
3133
working-directory: ${{ env.BUILD_DIR }}
3234
run: |
3335
cmake --build . --config Release
34-
shell: cmd
3536
3637
- name: Test
3738
working-directory: ${{ env.BUILD_DIR }}
3839
run: ctest -C Release
39-
shell: cmd

.github/workflows/Integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: IntegrationTests
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [ "master" ]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: [ "master" ]
88
workflow_dispatch:
99

1010
env:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Simple and Fast header only Bitmap (BMP) library
44
## Bitmap Type Supported
55
- 24 Bits Per Pixel (RGB)
66

7+
## Integration
8+
9+
You can either download the header file and use it your project directly, or you can leverage CMake for this. The library can be easily integrated with FetchContent or through CPM. An example of CPM integration can be found [here](integration_tests/cpm).
10+
711
## Examples
812
<strong>Random Pixel Colors</strong>
913
<br>

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ foreach(example_file ${EXAMPLES_FILES})
77
get_filename_component(target_name ${example_file} NAME_WE)
88

99
add_executable(${target_name} ${example_file})
10-
target_link_libraries( ${target_name} bpp::BitmapPlusPlus )
10+
target_link_libraries( ${target_name} bmp::BitmapPlusPlus )
1111
target_compile_definitions ( ${target_name} PRIVATE "ROOT_DIR=\"${PROJECT_SOURCE_DIR}\"" )
1212
target_compile_definitions ( ${target_name} PRIVATE "BIN_DIR=\"${PROJECT_BINARY_DIR}\"" )
1313

integration_tests/cpm/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ CPMAddPackage ( "gh:nerudaj/BitmapPlusPlus#${GIT_BRANCH}" )
88

99
project ( demo )
1010

11+
set(CMAKE_CXX_STANDARD 17) # C++17 or newer is required
12+
1113
add_executable( ${PROJECT_NAME}
12-
"${CMAKE_CURRENT_SOURCE_DIR}/../../examples/draw_primitives.cpp"
14+
"${CMAKE_CURRENT_SOURCE_DIR}/Main.cpp"
1315
)
1416

15-
target_link_libraries( ${PROJECT_NAME} LINK_PRIVATE bpp::BitmapPlusPlus )
17+
target_link_libraries( ${PROJECT_NAME} LINK_PRIVATE bmp::BitmapPlusPlus )

integration_tests/cpm/Main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <BitmapPlusPlus.hpp>
2+
3+
int main()
4+
{
5+
bmp::Bitmap bitmap(512, 512);
6+
for (auto& pixel : bitmap)
7+
{
8+
pixel = bmp::Pixel(42, 69, 96);
9+
}
10+
11+
bitmap.save("demo.bmp");
12+
}

integration_tests/cpm/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ And link it to your target using:
1414
target_link_libraries( ${TARGET} LINK_PRIVATE bpp::BitmapPlusPlus )
1515
```
1616

17-
After that, you can simply include the library in your code:
17+
Note that your target needs to compile with C++17 or newer. After that, you can simply include the library in your code:
1818

1919
```cpp
2020
#include <BitmapPlusPlus.hpp>

lib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ cmake_minimum_required ( VERSION 3.10 )
33
add_library ( BitmapPlusPlus INTERFACE )
44
target_include_directories( BitmapPlusPlus INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include" )
55

6-
add_library ( bpp::BitmapPlusPlus ALIAS BitmapPlusPlus )
6+
add_library ( bmp::BitmapPlusPlus ALIAS BitmapPlusPlus )

0 commit comments

Comments
 (0)