Skip to content

Commit 0cb7f57

Browse files
authored
ci: refactor test workflow for multi-OS and Lua support
Updated the GitHub Actions workflow to run tests on multiple operating systems and Lua versions.
1 parent 1ff6fea commit 0cb7f57

1 file changed

Lines changed: 95 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,101 @@
1-
name: Tests
2-
# Runs Busted tests across supported platforms and Lua versions.
1+
name: Test
32

43
on:
4+
push:
5+
paths:
6+
- "src/**"
7+
- "tests/**"
8+
- "scripts/**"
9+
- ".github/workflows/test.yml"
510
pull_request:
11+
paths:
12+
- "src/**"
13+
- "tests/**"
14+
- "scripts/**"
15+
- ".github/workflows/test.yml"
616
workflow_dispatch:
717

818
jobs:
9-
tests:
10-
uses: luamod/.github/.github/workflows/tests.yml@main
11-
with:
12-
lua_versions: '["luajit","5.1","5.2","5.3","5.4","5.5"]'
13-
luarocks_deps: |
14-
busted
15-
inspect
19+
test-unix:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, macos-latest]
24+
lua-version: ["5.1", "5.2", "5.3", "5.4", "5.5", "luajit"]
25+
26+
runs-on: ${{ matrix.os }}
27+
28+
defaults:
29+
run:
30+
shell: bash
31+
32+
steps:
33+
- uses: actions/checkout@v6
34+
35+
- uses: hishamhm/gh-actions-lua@master
36+
with:
37+
luaVersion: ${{ matrix.lua-version }}
38+
39+
- uses: hishamhm/gh-actions-luarocks@master
40+
with:
41+
luaRocksVersion: "3.13.0"
42+
43+
- name: Install dependencies
44+
run: |
45+
luarocks install busted
46+
luarocks install inspect
47+
48+
- name: Build
49+
run: luarocks make luarocks/mods-scm-1.rockspec
50+
51+
- name: Test
52+
run: busted
53+
54+
test-windows:
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
include:
59+
- toolchain: msvc
60+
lua-version: "5.1"
61+
- toolchain: msvc
62+
lua-version: "5.2"
63+
- toolchain: msvc
64+
lua-version: "5.3"
65+
- toolchain: msvc
66+
lua-version: "5.4"
67+
- toolchain: msvc
68+
lua-version: "5.5"
69+
- toolchain: mingw
70+
lua-version: "luajit"
71+
72+
runs-on: windows-latest
73+
74+
defaults:
75+
run:
76+
shell: pwsh
77+
78+
steps:
79+
- uses: actions/checkout@v6
80+
81+
- if: ${{ matrix.toolchain == 'msvc' }}
82+
uses: ilammy/msvc-dev-cmd@v1
83+
84+
- uses: hishamhm/gh-actions-lua@master
85+
with:
86+
luaVersion: ${{ matrix.lua-version }}
87+
88+
- uses: hishamhm/gh-actions-luarocks@master
89+
with:
90+
luaRocksVersion: "3.13.0"
91+
92+
- name: Install dependencies
93+
run: |
94+
luarocks install busted
95+
luarocks install inspect
96+
97+
- name: Build
98+
run: luarocks make luarocks/mods-scm-1.rockspec
99+
100+
- name: Test
101+
run: busted

0 commit comments

Comments
 (0)