mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
name: CMake
|
|
|
|
on:
|
|
push:
|
|
branches: [main, "3.*"]
|
|
pull_request:
|
|
branches: [main, "3.*"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install build tooling
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install "conan==2.5.0"
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build
|
|
|
|
- name: Cache Conan downloads
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.conan2
|
|
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt') }}
|
|
restore-keys: |
|
|
conan-${{ runner.os }}-
|
|
|
|
- name: Prepare Conan profile
|
|
run: conan profile detect --force
|
|
|
|
- name: Install Conan toolchain
|
|
run: conan install . --output-folder=build --build=missing
|
|
|
|
- name: Configure CMake (Ninja)
|
|
run: |
|
|
source build/conanrun.sh
|
|
cmake -S . -B build -G Ninja \
|
|
-DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake \
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
- name: Build
|
|
run: |
|
|
source build/conanrun.sh
|
|
cmake --build build --config Release
|
|
|
|
- name: Test
|
|
run: |
|
|
source build/conanrun.sh
|
|
ctest --test-dir build --output-on-failure --build-config Release
|