Add install and compile for CI pipeline #83
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: main | |
paths: ['**.cpp', '**.h', '**CMakeLists.txt'] | |
pull_request: | |
branches: main | |
paths: ['**.cpp', '**.h', '**CMakeLists.txt'] | |
jobs: | |
build-and-test: | |
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.1 | |
# Checkout the mcpp repository for building and testing | |
- name: Checkout mcpp | |
uses: actions/checkout@v4 | |
# Build files using CMake | |
- name: Build file | |
run: cmake -Bbuild | |
# Run the test suite using ctest | |
- 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 |