Skip to content

Add install and compile for CI pipeline #80

Add install and compile for CI pipeline

Add install and compile for CI pipeline #80

Workflow file for this run

name: CI
on:
push:
branches: main
paths: ['**.cpp', '**.h', '**CMakeLists.txt']
pull_request:
branches: main
paths: ['**.cpp', '**.h', '**CMakeLists.txt']
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# Start and join the Spigot Server
- name: Set up Minecraft testing environment
uses: nhatdongdang/[email protected]
# 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
install-and-compile:
strategy:
matrix:
os: [ubuntu-latest,macos-latest]
runs-on: ${{ matrix.os }}
steps:
# Checkout the mcpp repository
- name: Checkout mcpp
uses: actions/checkout@v4
- name: Build file
run: cmake .
- name: Install library
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 test/link_test.cpp -o test/link_test -lmcpp
- name: Run executable
run: test/link_test