Skip to content
Merged
Show file tree
Hide file tree
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
49 changes: 49 additions & 0 deletions .github/workflows/conan_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Conan CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install -y ninja-build pkg-config python3-pip build-essential

- name: Install Meson and Conan
run: |
pip install --upgrade pip
pip install meson==1.3.2 conan==2.3.2

- name: Detect Conan profile
run: conan profile detect

- name: Install dependencies
run: conan install . --profile default --build=missing

- name: Build
run: |
meson setup builddir
meson compile -C builddir

- name: Test
run: meson test -C builddir

- name: Package
run: conan create . --name=pizza_test --version=1.2.7
51 changes: 51 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from conan import ConanFile
from conan.tools.meson import Meson, MesonToolchain
from conan.tools.files import copy
import os

class PizzaTestConan(ConanFile):
name = "pizza_test"
version = "1.2.7"
license = "MPL-2.0"
author = "Fossil Logic <[email protected]>"
url = "https://github.com/fossillogic/fossil-test"
description = "Unit testing framework for software projects"
topics = ("testing", "mocking", "framework")

settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = {"shared": False}

exports_sources = "code/**", "meson.build", "meson.options"
generators = "PkgConfigDeps"

def layout(self):
"""Define a basic build/source folder layout"""
self.folders.source = "."
self.folders.build = "builddir"

def generate(self):
"""Generate Meson toolchain files"""
tc = MesonToolchain(self)
tc.generate()

def build(self):
"""Configure and build the project using Meson"""
meson = Meson(self)
meson.configure()
meson.build()

def package(self):
"""Install headers and libraries into package folder"""
meson = Meson(self)
meson.install()

# Ensure headers are included even if not installed by Meson
copy(self, "*.h",
src="code/logic/fossil/pizza",
dst=os.path.join(self.package_folder, "include", "fossil", "pizza"))

def package_info(self):
"""Set information for consumers of the package"""
self.cpp_info.libs = ["pizza_test"]
self.cpp_info.includedirs = ["include"]
Loading