Skip to content

Commit 6919be6

Browse files
committed
chore(ci): move Windows CI to Github Actions
1 parent 2936b22 commit 6919be6

1 file changed

Lines changed: 92 additions & 42 deletions

File tree

.github/workflows/unix_build.yml

Lines changed: 92 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,102 @@
11
name: "Unix build"
22

3-
on: [push, pull_request]
3+
concurrency:
4+
# for PR's cancel the running task, if another commit is pushed
5+
group: ${{ github.workflow }} ${{ github.ref }}
6+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
7+
8+
on:
9+
# build on PR and push-to-main. This works for short-lived branches, and saves
10+
# CPU cycles on duplicated tests.
11+
# For long-lived branches that diverge, you'll want to run on all pushes, not
12+
# just on push-to-main.
13+
pull_request: {}
14+
push:
15+
branches:
16+
- master
417

518
jobs:
619
test:
7-
runs-on: ubuntu-latest
8-
920
strategy:
1021
fail-fast: false
1122
matrix:
12-
luaVersion: ["5.1", "5.2", "5.3", "5.4", "5.5", "luajit-2.1.0-beta3", "luajit-openresty"]
23+
os:
24+
- "ubuntu-24.04"
25+
- "macos-latest"
26+
luaVersion:
27+
- "5.1"
28+
- "5.2"
29+
- "5.3"
30+
- "5.4"
31+
- "5.5"
32+
- "luajit"
33+
- "luajit-openresty"
34+
include:
35+
# On Windows builds:
36+
# 'hishamhm/gh-actions-lua' will build the PuC Rio Lua versions using
37+
# MSVC, and the LuaJIT version using MinGW/gcc. By running against
38+
# both below, we test both toolchains.
39+
- os: "windows-latest"
40+
toolchain: "msvc"
41+
luaVersion: "5.1"
42+
- os: "windows-latest"
43+
toolchain: "msvc"
44+
luaVersion: "5.2"
45+
- os: "windows-latest"
46+
toolchain: "msvc"
47+
luaVersion: "5.3"
48+
- os: "windows-latest"
49+
toolchain: "msvc"
50+
luaVersion: "5.4"
51+
- os: "windows-latest"
52+
toolchain: "mingw" # unused, other than for display in the UI
53+
luaVersion: "luajit"
54+
55+
runs-on: ${{ matrix.os }}
1356

1457
steps:
15-
- uses: actions/checkout@v4
16-
17-
- uses: hishamhm/gh-actions-lua@master
18-
with:
19-
luaVersion: ${{ matrix.luaVersion }}
20-
21-
- uses: hishamhm/gh-actions-luarocks@master
22-
with:
23-
luaRocksVersion: "3.13.0"
24-
25-
- name: dependencies
26-
run: |
27-
luarocks install busted
28-
luarocks install luacov-coveralls
29-
30-
- name: build
31-
run: |
32-
luarocks remove penlight --force
33-
luarocks make
34-
35-
- name: Busted tests
36-
run: |
37-
busted --coverage --Xoutput "--color"
38-
39-
- name: Old test suite
40-
run: |
41-
lua run.lua tests --luacov
42-
43-
- name: Examples
44-
run: |
45-
lua run.lua examples
46-
47-
- name: Report test coverage
48-
if: success()
49-
continue-on-error: true
50-
run: luacov-coveralls
51-
env:
52-
COVERALLS_REPO_TOKEN: ${{ github.token }}
58+
- name: Checkout
59+
uses: actions/checkout@master
60+
61+
- name: Setup MSVC
62+
# the 'hishamhm/gh-actions-lua' step requires msvc to build PuC Rio Lua
63+
# versions on Windows (LuaJIT will be build using MinGW/gcc).
64+
if: ${{ matrix.toolchain == 'msvc' }}
65+
uses: ilammy/msvc-dev-cmd@v1
66+
67+
- uses: hishamhm/gh-actions-lua@master
68+
with:
69+
luaVersion: ${{ matrix.luaVersion }}
70+
71+
- uses: hishamhm/gh-actions-luarocks@master
72+
with:
73+
luaRocksVersion: "3.13.0"
74+
75+
- name: dependencies
76+
run: |
77+
luarocks install busted
78+
luarocks install luacov-coveralls
79+
luarocks remove penlight --force
80+
81+
- name: build
82+
run: |
83+
luarocks make
84+
85+
- name: Busted tests
86+
run: |
87+
busted --coverage --Xoutput "--color"
88+
89+
- name: Old test suite
90+
run: |
91+
lua run.lua tests --luacov
92+
93+
- name: Examples
94+
run: |
95+
lua run.lua examples
96+
97+
- name: Report test coverage
98+
if: success()
99+
continue-on-error: true
100+
run: luacov-coveralls
101+
env:
102+
COVERALLS_REPO_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)