-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.61 KB
/
buildAndTest-Linux.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
name: "Build and Test on Ubuntu"
on: ["push", "pull_request"]
jobs:
RunTestsOnLinux:
name: "Ubuntu (Latest)"
runs-on: "ubuntu-latest"
strategy:
matrix:
compiler: ["gcc", "clang"]
lua:
[
"luajit libluajit-5.1-dev libluajit-5.1-2",
"liblua5.3-dev lua5.3",
"liblua5.2-dev lua5.2",
"liblua5.1-0-dev lua5.1",
]
steps:
- uses: "actions/checkout@v4"
- name: "Add Dependencies"
run: |
export COMPILER=${{ matrix.compiler }}
source scripts/compilerName.sh
sudo apt update
sudo apt install -yq ${{ matrix.lua }} "$C_COMPILER_PACKAGE" "$CXX_COMPILER_PACKAGE"
./scripts/buildLuaRocks.sh
sudo luarocks install luaunit
- name: "Build Project"
run: |
export COMPILER=${{ matrix.compiler }}
source scripts/compilerName.sh
luarocks config "variables.CMAKE_C_COMPILER" "$C_COMPILER"
luarocks config "variables.CMAKE_CXX_COMPILER" "$CXX_COMPILER"
sudo CXX="$CXX_COMPILER" CC="$C_COMPILER" luarocks make
- name: "Test Project"
run: |
if ! command -v lua &> /dev/null
then
luajit tests/tests.lua
exit
else
lua tests/tests.lua
fi