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
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: ✅ CI

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

jobs:
package_and_upload_all_check:
uses: libhal/ci/.github/workflows/package_and_upload_all.yml@5.x.y
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 🚀 Deploy

on:
workflow_dispatch:
release:
types: [published]

jobs:
deploy:
if: startsWith(github.ref, 'refs/tags/')
uses: libhal/ci/.github/workflows/package_and_upload_all.yml@5.x.y
with:
version: ${{ github.ref_name }}
remote_url: https://libhal.jfrog.io/artifactory/api/conan/trunk-conan
secrets:
conan_remote_password: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }}
conan_remote_user: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }}
46 changes: 46 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 🏷️ Semantic Release
on:
push:
branches: [main]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Version
id: version
uses: paulhatch/semantic-version@v5.4.0
with:
bump_each_commit: true
major_pattern: "(major)"
minor_pattern: "(minor)"
bump_each_commit_patch_pattern: "(patch)"
tag_prefix: ""
debug: true
- name: Release
if: steps.version.outputs.version_type != 'none'
run: |
gh release create ${{ steps.version.outputs.version_tag }} \
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
30 changes: 30 additions & 0 deletions .github/workflows/take.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# .github/workflows/take.yml
name: 📛 assign issue to contributor
on:
issue_comment:

jobs:
assign:
name: Take an issue
runs-on: ubuntu-latest
steps:
- name: take the issue
uses: bdougie/take-action@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
message: Thanks for taking this issue! Let us know if you have any questions!
28 changes: 16 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ cmake_minimum_required(VERSION 3.28)

# Generate compile commands for anyone using our libraries.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_COLOR_DIAGNOSTICS ON)

project(async_context LANGUAGES CXX)

# ==============================================================================
# Library
# ==============================================================================

find_package(strong_ptr REQUIRED)

add_library(async_context STATIC)
target_compile_features(async_context PUBLIC cxx_std_23)
target_link_libraries(async_context PUBLIC strong_ptr)
target_sources(async_context PUBLIC
FILE_SET CXX_MODULES
TYPE CXX_MODULES
Expand Down Expand Up @@ -56,21 +60,21 @@ install(

find_package(ut REQUIRED)

add_executable(async_unit_test)

# Add module files
target_sources(async_unit_test
PRIVATE
tests/main.test.cpp
tests/async.test.cpp
)

target_compile_features(async_unit_test PUBLIC cxx_std_23)
target_link_libraries(async_unit_test PRIVATE async_context boost-ext-ut::ut)

if(CMAKE_CROSSCOMPILING)
message(STATUS "Cross compiling, skipping unit test execution")
else()
add_executable(async_unit_test)
# Add module files
target_sources(async_unit_test
PRIVATE
tests/main.test.cpp
tests/async.test.cpp
)

target_compile_features(async_unit_test PUBLIC cxx_std_23)
target_compile_options(async_unit_test PRIVATE -g)
target_link_libraries(async_unit_test PRIVATE async_context Boost::ut)

message(STATUS "Executing unit tests!")
add_custom_target(run_tests ALL DEPENDS async_unit_test COMMAND async_unit_test)
endif()
Expand Down
10 changes: 4 additions & 6 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class async_context_conan(ConanFile):
description = ("Implementation of C++20 coroutines targeting embedded system by eliminating the usage of the global heap and providing a 'context' which contains a coroutine stack frame and other useful utilities for scheduling.")
topics = ("async", "coroutines", "stack", "scheduling", "scheduler")
settings = "compiler", "build_type", "os", "arch"
exports_sources = "include/*", "tests/*", "CMakeLists.txt", "LICENSE"
exports_sources = "modules/*", "tests/*", "CMakeLists.txt", "LICENSE"
package_type = "static-library"
shared = False

Expand Down Expand Up @@ -84,20 +84,18 @@ def validate(self):
self._validate_compiler_version()

def build_requirements(self):
self.tool_requires("cmake/4.1.1")
self.tool_requires("ninja/1.13.1")
# Provides CMake, Ninja, & toolchain scripts for enabling modules
self.tool_requires("cmake-modules-toolchain/1.0.2")
self.test_requires("boost-ext-ut/2.3.1")

def requirements(self):
pass
self.requires("strong_ptr/0.0.0")

def layout(self):
cmake_layout(self)

def generate(self):
tc = CMakeToolchain(self)
tc.generator = "Ninja"
tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True
tc.generate()

deps = CMakeDeps(self)
Expand Down
Loading