|
1 | | -name: CI |
| 1 | +name: "Unix build" |
2 | 2 |
|
3 | | -on: [ push, pull_request ] |
| 3 | +on: [push, pull_request] |
4 | 4 |
|
5 | 5 | jobs: |
6 | | - CI-Linux-LuaJIT: |
7 | | - name: "Linux x64 with LuaJIT" |
8 | | - runs-on: ubuntu-22.04 |
| 6 | + test: |
| 7 | + runs-on: ubuntu-latest |
9 | 8 |
|
10 | | - steps: |
11 | | - - name: Checkout code |
12 | | - uses: actions/checkout@v4 |
13 | | - |
14 | | - - name: Install dependencies |
15 | | - run: | |
16 | | - # Use the official APT repositories from OpenResty to install LuaJIT |
17 | | - curl -sSL "https://openresty.org/package/pubkey.gpg" | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg |
18 | | - echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] https://openresty.org/package/ubuntu $(lsb_release -sc) main" | \ |
19 | | - sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null |
20 | | - # Install dependencies |
21 | | - sudo apt-get update |
22 | | - sudo apt-get install --no-install-recommends openresty libvips-dev |
23 | | -
|
24 | | - - name: Install LuaRocks |
25 | | - env: |
26 | | - LUAROCKS_VERSION: 3.9.2 |
27 | | - run: |
28 | | - .ci/install-luarocks.sh |
29 | | - --with-lua=/usr/local/openresty/luajit/ |
30 | | - --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 |
31 | | - |
32 | | - - name: Prepare environment |
33 | | - run: | |
34 | | - echo "/usr/local/openresty/luajit/bin:$HOME/luarocks/bin" >> $GITHUB_PATH |
35 | | -
|
36 | | - - name: Install Lua modules |
37 | | - run: make dev |
38 | | - |
39 | | - - name: Lint with luacheck |
40 | | - run: make lint |
41 | | - |
42 | | - - name: Test with busted |
43 | | - run: make test |
44 | | - |
45 | | - CI-Linux-Lua-54: |
46 | | - name: "Linux x64 with Lua 5.4" |
47 | | - runs-on: ubuntu-22.04 |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + luaVersion: ["5.3", "5.4", "luajit-2.1.0-beta3", "luajit-openresty"] |
48 | 13 |
|
49 | 14 | steps: |
50 | | - - name: Checkout code |
51 | | - uses: actions/checkout@v4 |
52 | | - |
53 | | - - name: Install dependencies |
54 | | - run: | |
55 | | - sudo apt install lua5.4 liblua5.4-dev libvips-dev |
| 15 | + - uses: actions/checkout@v4 |
56 | 16 |
|
57 | | - - name: Install LuaRocks |
58 | | - env: |
59 | | - LUAROCKS_VERSION: 3.9.2 |
60 | | - run: |
61 | | - .ci/install-luarocks.sh |
62 | | - --with-lua=/usr/ |
63 | | - --with-lua-include=/usr/include/lua5.4 |
| 17 | + - uses: leafo/gh-actions-lua@v9 |
| 18 | + with: |
| 19 | + luaVersion: ${{ matrix.luaVersion }} |
64 | 20 |
|
65 | | - - name: Prepare environment |
66 | | - run: | |
67 | | - echo "/usr/bin:$HOME/luarocks/bin" >> $GITHUB_PATH |
| 21 | + - uses: leafo/gh-actions-luarocks@v4 |
68 | 22 |
|
69 | | - - name: Install Lua modules |
70 | | - run: make dev |
| 23 | + - name: Install libvips |
| 24 | + run: | |
| 25 | + sudo apt install --no-install-recommends libvips-dev |
71 | 26 |
|
72 | | - - name: Install ffi |
73 | | - run: make ffi |
| 27 | + - name: Lua dependencies |
| 28 | + run: | |
| 29 | + make dev |
| 30 | + if [[ ${{ matrix.luaVersion }} == 5.* ]]; then make ffi; fi |
74 | 31 |
|
75 | | - - name: Lint with luacheck |
76 | | - run: make lint |
| 32 | + - name: Lint with luacheck |
| 33 | + run: | |
| 34 | + make lint |
77 | 35 |
|
78 | | - - name: Test with busted |
79 | | - run: make test |
| 36 | + - name: Busted tests |
| 37 | + run: | |
| 38 | + make test |
0 commit comments