From 8fa7a73d7d7c81e9dc51e72b5133319dc253e807 Mon Sep 17 00:00:00 2001 From: nhatdongdang <144138246+nhatdongdang@users.noreply.github.com> Date: Mon, 9 Sep 2024 23:46:56 +1000 Subject: [PATCH 1/2] Update CI --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d925997..67c4f153 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,15 @@ on: jobs: build-and-test: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest,macos-latest] + + runs-on: ${{ matrix.os }} steps: # Start and join the Spigot Server - name: Set up Minecraft testing environment - uses: nhatdongdang/mc-env-setup@v1 + uses: nhatdongdang/mc-env-setup@v1.1 # Checkout the mcpp repository for building and testing - name: Checkout mcpp @@ -28,3 +32,17 @@ jobs: - name: Run test suite working-directory: ./build run: make test_suite && ctest -R full -V + + - name: Install library + working-directory: ./build + run: sudo make install + + - name: Update linux cache + if: runner.os == 'Linux' + run: sudo ldconfig + + - name: Compile and link library + run: g++ -std=c++17 example/pyramid.cpp -o example/pyramid -lmcpp + + - name: Run example + run: example/pyramid From 8beb6a53755b6c0fc232ec18820529a71dd13c59 Mon Sep 17 00:00:00 2001 From: nhatdongdang <144138246+nhatdongdang@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:00:27 +1000 Subject: [PATCH 2/2] Update example --- example/hello_minecraft.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/hello_minecraft.cpp b/example/hello_minecraft.cpp index 4ea01138..37c4bf65 100644 --- a/example/hello_minecraft.cpp +++ b/example/hello_minecraft.cpp @@ -4,5 +4,7 @@ using namespace mcpp; int main() { MinecraftConnection mc; + + // Post chat to Minecraft mc.postToChat("Hello, Minecraft!"); }