diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/ci.yml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..877c6dd --- /dev/null +++ b/.github/workflows/ci.yml | |||
@@ -0,0 +1,48 @@ | |||
1 | name: ci | ||
2 | |||
3 | on: [push, pull_request] | ||
4 | |||
5 | jobs: | ||
6 | TestMatrix: | ||
7 | strategy: | ||
8 | matrix: | ||
9 | lua-version: ["5.4", "5.3", "5.2", "5.1", "luajit"] | ||
10 | os: ["ubuntu-latest"] | ||
11 | libflag: ["-shared --coverage"] | ||
12 | include: | ||
13 | - os: "macos-latest" | ||
14 | lua-version: "5.4" | ||
15 | libflag: "-bundle -undefined dynamic_lookup -all_load --coverage" | ||
16 | runs-on: ${{ matrix.os }} | ||
17 | |||
18 | steps: | ||
19 | - uses: actions/checkout@master | ||
20 | |||
21 | - uses: leafo/gh-actions-lua@v8.0.0 | ||
22 | with: | ||
23 | luaVersion: ${{ matrix.lua-version }} | ||
24 | |||
25 | - uses: leafo/gh-actions-luarocks@master | ||
26 | |||
27 | - name: Prep | ||
28 | run: | | ||
29 | pip install --user cpp-coveralls | ||
30 | luarocks install lua-path | ||
31 | luarocks install dkjson | ||
32 | luarocks install luacov | ||
33 | # install luacov-coveralls, but avoid installing luafilesystem | ||
34 | luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=none | ||
35 | |||
36 | - name: Build | ||
37 | run: | | ||
38 | luarocks make CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="${{ matrix.libflag }}" | ||
39 | |||
40 | - name: Test | ||
41 | run: | | ||
42 | lua -lluacov tests/test.lua | ||
43 | |||
44 | - name: Coverage | ||
45 | run: | | ||
46 | export PATH="/Users/runner/Library/Python/2.7/bin:$PATH" | ||
47 | coveralls -b . -i src --dump c.report.json | ||
48 | luacov-coveralls -j c.report.json -v -t ${{ secrets.GITHUB_TOKEN }} | ||