-
Notifications
You must be signed in to change notification settings - Fork 18
50 lines (40 loc) · 1.38 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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:
# Checkout the mcpp repository for building and testing
- name: Checkout mcpp
uses: actions/checkout@v4
# Build CMake cache
- name: Build file
run: cmake --debug-output -B build
- name: Install library
working-directory: ./build
run: sudo make install
- name: Update linux cache
if: runner.os == 'ubuntu-latest'
run: sudo ldconfig
- name: Compile and link library
working-directory: ./build
run: make examples
# Start and join the Spigot Server
- name: Set up Minecraft testing environment
uses: nhatdongdang/[email protected]
# Run the test suite using ctest
- name: Run test suite
working-directory: ./build
run: make test_suite && ctest -R full -V
- name: Run example
working-directory: ./build
run: ./hello_minecraft