|
1 | 1 | name: "Unix build" |
2 | 2 |
|
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 |
4 | 17 |
|
5 | 18 | jobs: |
6 | 19 | test: |
7 | | - runs-on: ubuntu-latest |
8 | | - |
9 | 20 | strategy: |
10 | 21 | fail-fast: false |
11 | 22 | 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: "msvc" |
| 53 | + luaVersion: "5.5" |
| 54 | + - os: "windows-latest" |
| 55 | + toolchain: "mingw" # unused, other than for display in the UI |
| 56 | + luaVersion: "luajit" |
| 57 | + |
| 58 | + runs-on: ${{ matrix.os }} |
13 | 59 |
|
14 | 60 | 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 }} |
| 61 | + - name: Checkout |
| 62 | + uses: actions/checkout@master |
| 63 | + |
| 64 | + - name: Setup MSVC |
| 65 | + # the 'hishamhm/gh-actions-lua' step requires msvc to build PuC Rio Lua |
| 66 | + # versions on Windows (LuaJIT will be build using MinGW/gcc). |
| 67 | + if: ${{ matrix.toolchain == 'msvc' }} |
| 68 | + uses: ilammy/msvc-dev-cmd@v1 |
| 69 | + |
| 70 | + - uses: hishamhm/gh-actions-lua@master |
| 71 | + with: |
| 72 | + luaVersion: ${{ matrix.luaVersion }} |
| 73 | + |
| 74 | + - uses: hishamhm/gh-actions-luarocks@master |
| 75 | + with: |
| 76 | + luaRocksVersion: "3.13.0" |
| 77 | + |
| 78 | + - name: dependencies |
| 79 | + run: | |
| 80 | + luarocks install busted |
| 81 | + luarocks install luacov-coveralls |
| 82 | + luarocks remove penlight --force |
| 83 | +
|
| 84 | + - name: build |
| 85 | + run: | |
| 86 | + luarocks make |
| 87 | +
|
| 88 | + - name: Busted tests |
| 89 | + run: | |
| 90 | + busted --coverage --Xoutput "--color" |
| 91 | +
|
| 92 | + - name: Old test suite |
| 93 | + run: | |
| 94 | + lua run.lua tests --luacov |
| 95 | +
|
| 96 | + - name: Examples |
| 97 | + run: | |
| 98 | + lua run.lua examples |
| 99 | +
|
| 100 | + - name: Report test coverage |
| 101 | + if: success() |
| 102 | + continue-on-error: true |
| 103 | + run: luacov-coveralls |
| 104 | + env: |
| 105 | + COVERALLS_REPO_TOKEN: ${{ github.token }} |
0 commit comments