Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CMake Build Pipeline

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
# Windows (MSVC) puts the .exe in a subfolder named after the build type
bin_path: ./Release/TestApp.exe
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
# Linux (GCC) puts the binary directly in the build folder with no extension
bin_path: ./TestApp

steps:
- uses: actions/checkout@v4

- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libopencv-dev libtesseract-dev libleptonica-dev

- name: Configure CMake
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S .

- name: Build
run: cmake --build build --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ github.workspace }}/build
# This now uses the correct path defined in your matrix above!
run: ${{ matrix.bin_path }}