Skip to content

Commit

Permalink
Merge pull request #87 from nhatdongdang/feature/install-and-compile
Browse files Browse the repository at this point in the history
Add install and compile for CI pipeline
  • Loading branch information
rozukke authored Sep 9, 2024
2 parents 05f4c64 + 8beb6a5 commit 38af0d3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions example/hello_minecraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ using namespace mcpp;

int main() {
MinecraftConnection mc;

// Post chat to Minecraft
mc.postToChat("Hello, Minecraft!");
}

0 comments on commit 38af0d3

Please sign in to comment.