-
Notifications
You must be signed in to change notification settings - Fork 38
68 lines (67 loc) · 2.31 KB
/
compat53-tests.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: compat53-tests
on:
push:
branches: ["master"]
pull_request:
jobs:
compat53-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- luaVersion: "lua=5.1"
compiler: gcc
external: false
- luaVersion: "lua=5.1"
compiler: gcc
external: true
- luaVersion: "lua=5.1"
compiler: g++
external: true
- luaVersion: "lua=5.1"
compiler: clang
external: true
- luaVersion: "[email protected] --compat=none"
compiler: gcc
external: false
- luaVersion: "[email protected] --compat=none"
compiler: gcc
external: true
- luaVersion: "[email protected] --compat=all"
compiler: gcc
external: false
- luaVersion: "[email protected] --compat=all"
compiler: gcc
external: true
- luaVersion: "lua=5.2"
compiler: gcc
external: false
- luaVersion: "lua=5.2"
compiler: gcc
external: true
- luaVersion: "lua=5.2"
compiler: g++
external: true
steps:
- uses: actions/checkout@v2
- name: install Lua
run: |
pip3 install --user hererocks
~/.local/bin/hererocks old --${{ matrix.luaVersion }}
test -e old/bin/lua || (cd old/bin && ln -s luajit* lua)
~/.local/bin/hererocks new --lua=5.3
- name: compile C modules
run: |
export CC=${{ matrix.compiler }} CFLAGS="-Wall -Wextra -Ic-api -O2 -fPIC"
export DEF="" SRC=""
if [ "${{ matrix.external }}" = true ]; then DEF="-DCOMPAT53_PREFIX=compat53" SRC="c-api/compat-5.3.c"; fi
${CC} ${CFLAGS} -Iold/include ${DEF} -shared -o old/testmod.so tests/testmod.c ${SRC}
${CC} ${CFLAGS} -Inew/include ${DEF} -shared -o new/testmod.so tests/testmod.c ${SRC}
${CC} ${CFLAGS} -Iold/include ${DEF} -shared -o old/compat53.so ltablib.c lutf8lib.c lstrlib.c liolib.c ${SRC}
- name: run test scripts
run: |
(cd old && bin/lua ../tests/test.lua) > old.txt
(cd new && bin/lua ../tests/test.lua) > new.txt
- name: compare script output
run: diff old.txt new.txt || true