CI: add Windows run

This commit is contained in:
Hisham Muhammad
2024-10-28 14:41:59 -03:00
parent 71ae24046c
commit b6abbb63b1

View File

@@ -13,35 +13,60 @@ jobs:
- os: "macos-latest" - os: "macos-latest"
lua-version: "5.4" lua-version: "5.4"
libflag: "-bundle -undefined dynamic_lookup -all_load --coverage" libflag: "-bundle -undefined dynamic_lookup -all_load --coverage"
- os: "windows-latest"
toolchain: "msvc"
lua-version: "5.4"
- os: "windows-latest"
lua-version: "luajit"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- name: Setup MSVC
# 'luarocks/gh-actions-lua' step requires msvc to build PUC-Rio Lua
# versions on Windows (LuaJIT will be built using MinGW/gcc).
if: ${{ matrix.toolchain == 'msvc' }}
uses: ilammy/msvc-dev-cmd@v1
- uses: luarocks/gh-actions-lua@master - uses: luarocks/gh-actions-lua@master
with: with:
luaVersion: ${{ matrix.lua-version }} luaVersion: ${{ matrix.lua-version }}
- uses: luarocks/gh-actions-luarocks@master - uses: luarocks/gh-actions-luarocks@master
- name: Prep - name: Prep luacov
run: |
luarocks install luacov
- name: Prep luacov-coveralls
# TODO Windows coverage
if: ${{ matrix.os != 'windows-latest' }}
run: | run: |
pip install --user cpp-coveralls pip install --user cpp-coveralls
# install luacov-coveralls, but avoid installing luafilesystem
luarocks install lua-path luarocks install lua-path
luarocks install dkjson luarocks install dkjson
luarocks install luacov
# install luacov-coveralls, but avoid installing luafilesystem
luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=none luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=none
- name: Build - name: Unix Build
if: ${{ matrix.os != 'windows-latest' }}
run: | run: |
luarocks make CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="${{ matrix.libflag }}" luarocks make CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="${{ matrix.libflag }}"
- name: Windows Build
# TODO Windows coverage
if: ${{ matrix.os == 'windows-latest' }}
run: |
luarocks make
- name: Test - name: Test
run: | run: |
lua -lluacov tests/test.lua lua -lluacov tests/test.lua
- name: Coverage - name: Coverage
# TODO Windows coverage
if: ${{ matrix.os != 'windows-latest' }}
run: | run: |
export MY_PYTHON_VER=$(python -c 'import sys; print(".".join(sys.version.split(".")[0:2]))') export MY_PYTHON_VER=$(python -c 'import sys; print(".".join(sys.version.split(".")[0:2]))')
export PATH="/Users/runner/Library/Python/$MY_PYTHON_VER/bin:$PATH" export PATH="/Users/runner/Library/Python/$MY_PYTHON_VER/bin:$PATH"