Skip to content
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

Add install and compile for CI pipeline #87

Merged
merged 2 commits into from
Sep 9, 2024
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
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!");
}