-
-
Notifications
You must be signed in to change notification settings - Fork 99
104 lines (100 loc) · 3.39 KB
/
test.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
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
name: Test
on: [ push, pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
luaVersion:
- [ '5.4', 'MYCFLAGS=-fPIC' ]
- [ '5.3', 'MYCFLAGS=-fPIC' ]
- [ '5.2', 'MYCFLAGS=-fPIC' ]
- [ '5.1', 'CFLAGS="-O2 -Wall -DLUA_USE_LINUX -fPIC"' ]
- [ 'luajit', 'XCFLAGS=-fPIC' ]
- [ 'luajit-openresty', 'XCFLAGS=-fPIC' ]
runs-on: ubuntu-22.04
name: Test on Lua ${{ matrix.luaVersion[0] }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
uses: actions/cache@v4
with:
path: |
.fonts
.sources
key: fonts-${{ hashFiles('Makefile-fonts') }}
- name: Cache lua_modules
uses: actions/cache@v4
with:
path: |
lua_modules
key: luarocks-${{ matrix.luaVersion[0] }}-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install fonts-sil-gentiumplus libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev libpng-dev poppler-utils
- name: Setup ‘lua’
uses: hishamhm/gh-actions-lua@master
with:
luaVersion: ${{ matrix.luaVersion[0] }}
luaCompileFlags: ${{ matrix.luaVersion[1] }}
- name: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Setup ‘luarocks’
uses: hishamhm/gh-actions-luarocks@master
- name: Prep system Lua for use
run: |
luarocks install busted
function deepest () { find $1 -type d | awk 'length>m{m=length;r=$0}END{print r}'; }
cat << EOF >> $GITHUB_ENV
LD_LIBRARY_PATH=$PWD/.lua/lib:$LD_LIBRARY_PATH
LIBRARY_PATH=$PWD/.lua/lib:$LIBRARY_PATH
LD_RUN_PATH=$PWD/.lua/lib:$LD_RUN_PATH
PKG_CONFIG_PATH=$PWD/.lua/lib/pkgconfig:$PKG_CONFIG_PATH
LUA_INCLUDE=-I$(deepest $PWD/.lua/include)
MAKEFLAGS=-j$(nproc) -Otarget
EOF
- name: Configure
run: |
./bootstrap.sh
./configure \
${{ matrix.luaVersion[1] }} \
--enable-developer-mode \
--without-developer-tools \
BUSTED=$(which busted) \
--disable-font-variations \
--with${{ !startsWith(matrix.luaVersion[0], 'luajit') && 'out' || '' }}-luajit \
--without-system-luarocks \
--without-manual
- name: Make
run: |
make
- name: Prove SILE runs at all
run: |
make selfcheck
- name: Test Busted
continue-on-error: ${{ matrix.luaVersion[0] == '5.1' }}
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make busted
- name: Test Regressions
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make regressions
- name: Test Cargo
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make cargo-test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: test-${{ matrix.luaVersion[0] }}-actuals
path: tests/*.actual