Skip to content

Commit

Permalink
add macOS workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdawson committed Nov 27, 2022
1 parent 834f422 commit 42b1bc6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 🍎 macOS

# TODO: upload *.dylib / *.framework as artifacts

on:
push:
paths:
- "doc/cpp-demo/**"
branches-ignore:
- godot3
pull_request:
paths:
- "doc/cpp-demo/**"
branches-ignore:
- godot3

env:
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
VCPKG_DISABLE_METRICS: 1
vcpkg_tag: "2022.11.14"
source: "${{ github.workspace }}/doc/cpp-demo"
build: "${{ github.workspace }}/doc/cpp-demo/build.debug"
preset: debug
config: Debug

jobs:
analyze:
name: Build
runs-on: macos-latest

steps:
- name: macOS deps
run: |
brew install ninja
- uses: actions/checkout@v3

- name: Get vcpkg
run: |
git clone -n https://github.com/microsoft/vcpkg
cd vcpkg
git checkout ${{ env.vcpkg_tag }}
./bootstrap-vcpkg.sh
- name: CMake Configure
run: cmake --preset ${{ env.preset }} ${{ env.source }}

- name: CMake Build
run: cmake --build ${{ env.build }} --config ${{ env.config }} --target install

- name: CMake Test
working-directory: ${{ env.build }}
run: ctest -C ${{env.config}}
8 changes: 7 additions & 1 deletion doc/cpp-demo/src/MyCppNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ using namespace godot;

struct MyCppNode::Impl
{
bool show_imgui_demo = true;
bool show_implot_demo = true;
};

MyCppNode::MyCppNode() : impl(std::make_unique<Impl>())
Expand Down Expand Up @@ -71,7 +73,11 @@ void MyCppNode::_exit_tree()

void MyCppNode::_process(double delta)
{
ImPlot::ShowDemoWindow();
if (impl->show_imgui_demo)
ImGui::ShowDemoWindow(&impl->show_imgui_demo);

if (impl->show_implot_demo)
ImPlot::ShowDemoWindow(&impl->show_implot_demo);

ImGui::Begin("Cpp Window");
ImGui::Text("hello from C++");
Expand Down

0 comments on commit 42b1bc6

Please sign in to comment.