Skip to content

Improve actions #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 8, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 'dev**'
pull_request:
schedule:
- cron: '0 5 * * *'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cmake_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 'dev**'
pull_request:
schedule:
- cron: '0 5 * * *'
Expand All @@ -13,7 +14,7 @@ jobs:
name: CMake-Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Run CMake format
run: |
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: MacOS

on:
push:
branches:
- main
- 'dev**'
tags:
- '*'
pull_request:
schedule:
- cron: '0 5 * * *'

# allow manually starting this workflow
workflow_dispatch:

env:
VCPKG_PKGS: >-
boost-dll boost-filesystem boost-algorithm
boost-smart-ptr gtest

jobs:
macos_ci:
name: MacOS
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
path: workspace/src/plugin_loader

- name: vcpkg build
uses: johnwason/vcpkg-action@v7
id: vcpkg
with:
pkgs: ${{ env.VCPKG_PKGS }}
triplet: arm64-osx-release
cache-key: build-macos-14
token: ${{ github.token }}
- name: install-depends
shell: bash
run: |
python3 -m pip install vcstool --break-system-packages -q
python3 -m pip install colcon-common-extensions --break-system-packages -q

- name: update environment
shell: bash
run: |
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/arm64-osx-release/lib" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE\vcpkg\installed\arm64-osx-release" >> "$GITHUB_ENV"

- name: Build and Tests
uses: johnwason/colcon-action@macos
with:
ccache-prefix: ${{ matrix.distro }}
vcs-file: plugin_loader/dependencies.repos
upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=arm64-osx-release -DCMAKE_BUILD_TYPE=Release
target-path: workspace/src
target-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=arm64-osx-release -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DENABLE_CPACK=ON

- name: Package
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
working-directory: workspace/build/boost_plugin_loader
run: |
cpack --config CPackConfig.cmake
cp ./*.nupkg ${{ github.workspace }}/artifacts
cp ./*.tar.xz ${{ github.workspace }}/artifacts

1 change: 1 addition & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 'dev**'
pull_request:
schedule:
- cron: '0 5 * * *'
Expand Down
67 changes: 25 additions & 42 deletions .github/workflows/windows_2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 'dev**'
tags:
- '*'
pull_request:
Expand All @@ -23,62 +24,44 @@ jobs:
name: Windows-2022
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: workspace/src/plugin_loader

- name: checkout-vcpkg
uses: actions/checkout@v2
- name: configure-msvc
uses: ilammy/msvc-dev-cmd@v1
with:
path: vcpkg
repository: microsoft/vcpkg

- name: bootstrap-vcpkg
working-directory: vcpkg
run: bootstrap-vcpkg.bat

- name: vcpkg-dry-run
working-directory: vcpkg
shell: cmd
run: |
vcpkg install --dry-run --triplet x64-windows ${{ env.VCPKG_PKGS }} > vcpkg_dry_run.txt
arch: x64

- name: cache-vcpkg-archives
if: startsWith(github.ref, 'refs/tags/v') != true
id: cache-vcpkg-archives
uses: pat-s/always-upload-cache@v3
- name: vcpkg build
uses: johnwason/vcpkg-action@v7
id: vcpkg
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: ${{ runner.os }}-x64-vcpkg-${{ hashFiles('vcpkg/vcpkg_dry_run.txt') }}-main

pkgs: ${{ env.VCPKG_PKGS }}
triplet: x64-windows-release
cache-key: build-windows-2022
token: ${{ github.token }}
- name: install-depends
shell: cmd
run: |
vcpkg integrate install
python -m pip install vcstool -q
python -m pip install colcon-common-extensions -q
python -m pip install ninja -q
vcpkg install --triplet x64-windows ${{ env.VCPKG_PKGS }}

- name: configure-msvc
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: build-workspace
working-directory: workspace
shell: cmd
- name: update environment
shell: bash
run: |
vcs import --input "${{ github.workspace }}/workspace/src/plugin_loader/dependencies.repos" src/
colcon build --event-handlers console_direct+ --cmake-args -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DENABLE_CPACK=ON
if %ERRORLEVEL% GEQ 1 exit 1
echo "PATH=${{ env.PATH }};$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release\bin" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release" >> "$GITHUB_ENV"

- name: run-test
working-directory: workspace
shell: cmd
run: |
colcon test --event-handlers console_direct+ --return-code-on-test-failure
colcon test-result --verbose
- name: Build and Tests
uses: tesseract-robotics/colcon-action@v11
with:
ccache-prefix: ${{ matrix.distro }}
vcs-file: plugin_loader/dependencies.repos
upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release
target-path: workspace/src
target-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DENABLE_CPACK=ON

- name: Package
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ std::vector<std::string> getAllAvailableSections(const boost::dll::shared_librar
if (include_hidden)
return false;

return (section.substr(0, 1) == ".");
return (section.substr(0, 1) == ".") || (section.substr(0, 2) == "__");
};

sections.erase(std::remove_if(sections.begin(), sections.end(), search_fn), sections.end());
Expand Down
4 changes: 4 additions & 0 deletions test/plugin_loader_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ TEST(BoostPluginLoaderUnit, Utils) // NOLINT
EXPECT_EQ(s.size(), 2);
}

#ifndef __APPLE__
{
const std::optional<boost::dll::shared_library> lib =
loadLibrary(boost::filesystem::path("does_not_exist") / lib_name);
EXPECT_FALSE(lib.has_value());
}
#endif

{
const std::optional<boost::dll::shared_library> lib = loadLibrary(boost::filesystem::path(lib_dir) / "does_not_"
Expand Down Expand Up @@ -237,6 +239,7 @@ TEST(BoostPluginLoaderUnit, LoadTestPlugin) // NOLINT
}
#endif

#ifndef __APPLE__
{
PluginLoader plugin_loader;
plugin_loader.search_system_folders = false;
Expand All @@ -248,6 +251,7 @@ TEST(BoostPluginLoaderUnit, LoadTestPlugin) // NOLINT
// NOLINTNEXTLINE(cppcoreguidelines-avoid-goto)
EXPECT_ANY_THROW(plugin_loader.createInstance<TestPluginBase>("plugin"));
}
#endif

{
PluginLoader plugin_loader;
Expand Down
Loading