Repository navigation
150 lines (126 loc) · 4.22 KB
/
Copy pathc-cpp.yml
File metadata and controls
150 lines (126 loc) · 4.22 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
linux-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
lua_version: ["5.1", "5.2", "5.3", "5.4"]
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
pkg="liblua${{ matrix.lua_version }}-dev"
if [ "${{ matrix.lua_version }}" = "5.1" ]; then pkg=liblua5.1-0-dev; fi
sudo apt-get install -y "$pkg"
- name: Configure CMake
env:
CC: ${{ matrix.compiler == 'gcc' && 'gcc' || 'clang' }}
CXX: ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBLUA_BUILD_TESTS=ON \
-DLUA_INCLUDE_DIR=/usr/include/lua${{ matrix.lua_version }} \
-DLUA_LIBRARY=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/liblua${{ matrix.lua_version }}.so
- name: Build
run: |
cmake --build build --config Release
- name: Run Tests
run: |
ctest --test-dir build --output-on-failure -C Release
linux-luajit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LuaJIT
run: |
sudo apt-get update
sudo apt-get install -y libluajit-5.1-dev pkg-config
- name: Configure CMake
run: |
LUA_INC=$(pkg-config --cflags-only-I luajit | awk '{print substr($1,3)}')
LUA_LIBDIR=$(pkg-config --variable=libdir luajit)
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBLUA_BUILD_TESTS=ON \
-DLUA_INCLUDE_DIR="${LUA_INC}" \
-DLUA_LIBRARY="${LUA_LIBDIR}/libluajit-5.1.so"
- name: Build
run: |
cmake --build build --config Release
- name: Run Tests
run: |
ctest --test-dir build --output-on-failure -C Release
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
brew install lua
- name: Configure CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBLUA_BUILD_TESTS=ON
- name: Build
run: |
cmake --build build --config Release
- name: Run Tests
run: |
ctest --test-dir build --output-on-failure -C Release
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Checkout pinned official Lua 5.4.7 sources
uses: actions/checkout@v4
with:
repository: lua/lua
ref: 1ab3208a1fceb12fca8f24ba57d6e13c5bff15e3
path: .ci-deps/lua
persist-credentials: false
- name: Build external Lua with MSVC
shell: pwsh
run: |
cmake -S test/lua-runtime -B build-lua "-DLUA_SOURCE_DIR=$pwd/.ci-deps/lua"
cmake --build build-lua --config Release --parallel
cmake --install build-lua --config Release --prefix "$pwd/.ci-deps/lua-install"
- name: Configure CMake
shell: pwsh
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBLUA_BUILD_TESTS=ON `
"-DLUA_INCLUDE_DIR=$pwd/.ci-deps/lua-install/include" `
"-DLUA_LIBRARY=$pwd/.ci-deps/lua-install/lib/lua.lib"
- name: Build
run: |
cmake --build build --config Release
- name: Run Tests
run: |
ctest --test-dir build --output-on-failure -C Release
linux-debug:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizers: ["OFF", "ON"]
steps:
- uses: actions/checkout@v4
- name: Install Lua
run: |
sudo apt-get update
sudo apt-get install -y liblua5.4-dev
- name: Configure Debug
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBLUA_ENABLE_SANITIZERS=${{ matrix.sanitizers }} \
-DLUA_INCLUDE_DIR=/usr/include/lua5.4 \
-DLUA_LIBRARY=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/liblua5.4.so
- name: Build
run: cmake --build build --parallel
- name: Test (including failure checks and relocated consumer)
env:
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
run: ctest --test-dir build --output-on-failure