-
Notifications
You must be signed in to change notification settings - Fork 27
103 lines (87 loc) · 2.59 KB
/
test.yml
File metadata and controls
103 lines (87 loc) · 2.59 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build & Test
on:
push:
paths:
- 'src/**'
- 'unittests/**'
- 'CMakeLists.txt'
- 'configure.ac'
- 'Makefile.am'
- '.github/workflows/test.yml'
pull_request:
branches: [master, main]
paths:
- 'src/**'
- 'unittests/**'
- 'CMakeLists.txt'
- 'configure.ac'
- 'Makefile.am'
- '.github/workflows/test.yml'
jobs:
build:
name: Build Project
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libmariadb-dev libssl-dev zlib1g-dev autoconf automake libtool libgd-dev libcurl4-openssl-dev libjson-c-dev
- name: Copy config headers
run: |
cp src/campaign.example.h src/campaign.h
cp src/mud_options.example.h src/mud_options.h
cp src/vnums.example.h src/vnums.h
- name: Configure with autotools
run: |
autoreconf -fvi
./configure
- name: Build
run: make -j"$(nproc)"
- name: Verify binary exists
run: |
test -f circle
echo "Build successful: circle binary created"
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Build unit tests
working-directory: unittests/CuTest
run: make all
- name: Run unit tests
working-directory: unittests/CuTest
run: ./vessel_tests
- name: Run stress tests
working-directory: unittests/CuTest
run: ./vessel_stress_test
memory-check:
name: Memory Leak Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential valgrind
- name: Build unit tests
working-directory: unittests/CuTest
run: make all
- name: Run Valgrind on unit tests
working-directory: unittests/CuTest
run: |
valgrind --leak-check=full --track-origins=yes --error-exitcode=1 ./vessel_tests 2>&1 | tee valgrind.log
# Check for memory leaks
if grep -q "definitely lost: [1-9]" valgrind.log; then
echo "::error::Memory leaks detected!"
exit 1
fi
echo "No memory leaks detected"