Merge branch 'master' of https://github.com/Royna2544/c_cpp_telegrambot #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Glider (Multi-Platform) | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: 🚧 ${{ matrix.os }} ${{ matrix.cc }} ${{ matrix.str }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # --- Linux Builds --- | |
| - os: ubuntu-latest | |
| cc: GCC | |
| real_cc: gcc | |
| real_cxx: g++ | |
| flags: -DTGBOTCPP_RUST_MODULES=ON | |
| str: (Rust) | |
| - os: ubuntu-latest | |
| cc: GCC | |
| real_cc: gcc | |
| real_cxx: g++ | |
| flags: '-DBUILD_SHARED_LIBS=ON' | |
| str: (Shared) | |
| - os: ubuntu-latest | |
| cc: Clang | |
| real_cc: clang | |
| real_cxx: clang++ | |
| flags: -DTGBOTCPP_RUST_MODULES=ON -DBUILD_SHARED_LIBS=ON | |
| str: (Rust, Shared) | |
| - os: ubuntu-latest | |
| cc: Clang | |
| real_cc: clang | |
| real_cxx: clang++ | |
| flags: '' | |
| # --- macOS Build --- | |
| - os: macos-latest | |
| cc: AppleClang | |
| real_cc: clang | |
| real_cxx: clang++ | |
| flags: -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 | |
| - os: macos-latest | |
| cc: AppleClang | |
| real_cc: clang | |
| real_cxx: clang++ | |
| flags: -DBUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 | |
| str: (Shared) | |
| # --- Windows Build --- | |
| - os: windows-latest | |
| cc: MSVC | |
| real_cc: cl.exe | |
| real_cxx: cl.exe | |
| flags: '' | |
| env: | |
| VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache vcpkg binaries | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg_cache | |
| # Cache key depends on OS, compiler, and the vcpkg.json file | |
| key: vcpkg-${{ matrix.os }}-${{ matrix.cc }}-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: | | |
| vcpkg-${{ matrix.os }}-${{ matrix.cc }}- | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| if: matrix.os == 'macos-latest' | |
| with: | |
| xcode-version: latest-stable | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgJsonGlob: 'vcpkg.json' | |
| - name: Install Build Dependencies (Linux Only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt update | |
| sudo apt install -y autoconf autoconf-archive automake libtool libxrandr-dev \ | |
| libx11-dev libxft-dev libxext-dev libltdl-dev libxi-dev libxtst-dev \ | |
| x11-xserver-utils gi-docgen nasm | |
| - name: Configure CMake | |
| shell: bash | |
| env: | |
| CC: ${{ matrix.real_cc }} | |
| CXX: ${{ matrix.real_cxx }} | |
| run: | | |
| # Use different path syntax for Windows toolchain if needed | |
| VCPKG_PATH="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" | |
| cmake -B build -S . \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_TOOLCHAIN_FILE="$VCPKG_PATH" \ | |
| -DTGBOTCPP_BUILD_TESTS=ON \ | |
| ${{ matrix.flags }} | |
| - name: Build project | |
| run: | | |
| cmake --build build --config Release | |
| cmake --build build --config Release --target optional_all | |
| - name: Run Tests | |
| shell: bash | |
| run: | | |
| cd build | |
| ctest -C Release --output-on-failure --timeout 30 |