From 426df81b2f347aa1d2d9dfbdedc4d85114974586 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 27 Jan 2021 02:49:21 +1100 Subject: [PATCH] .github/workflows: use github actions for CI --- .github/workflows/ci.yml | 106 +++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 107 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f0d8f786 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,106 @@ +name: ci + +on: [push, pull_request] + +jobs: + luacheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + path: lua-http + - uses: leafo/gh-actions-lua@v8.0.0 + - uses: leafo/gh-actions-luarocks@v4.0.0 + - name: install-tooling + run: luarocks install luacheck + - name: luacheck + run: | + cd lua-http + luacheck . + + test: + runs-on: ubuntu-latest + strategy: + matrix: + luaVersion: + - "5.1" + - "5.2" + - "5.3" + - "5.4" + - luajit-2.0.5 + - luajit-2.1.0-beta3 + luaCompileFlags: [""] + zlib: ["", "lzlib", "lua-zlib"] + remove_compat53: [false] + + exclude: + # lzlib doesn't support Lua 5.4+ + - luaVersion: "5.4" + zlib: "lzlib" + include: + - luaVersion: "5.3" + luaCompileFlags: LUA_CFLAGS="-DLUA_INT_TYPE=LUA_INT_INT" + - luaVersion: "5.3" + remove_compat53: true + + steps: + - uses: actions/checkout@v2 + with: + path: lua-http + - uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: ${{ matrix.luaVersion }} + - uses: leafo/gh-actions-luarocks@v4.0.0 + - name: install-tooling + run: | + luarocks install luacov-coveralls + luarocks install busted + - name: install-dependencies + run: | + cd lua-http + luarocks install --only-deps http-scm-0.rockspec + + - name: install-lzlib + if: matrix.zlib == 'lzlib' + run: luarocks install lzlib + - name: install-lua-zlib + if: matrix.zlib == 'lua-zlib' + run: luarocks install lua-zlib + + - name: remove-compat53 + if: matrix.remove_compat53 + run: luarocks remove compat53 + + - name: test + run: | + cd lua-http + busted -c -o utfTerminal + + - name: coveralls + continue-on-error: true + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + cd lua-http + luacov-coveralls -v + + typedlua: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + path: lua-http + - uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: "5.3" # tlc doesn't work with 5.4+ + - uses: leafo/gh-actions-luarocks@v4.0.0 + - name: install-tooling + run: luarocks install https://raw.githubusercontent.com/andremm/typedlua/master/typedlua-scm-1.rockspec + - name: install-dependencies + run: | + cd lua-http + luarocks install --only-deps http-scm-0.rockspec + - name: typedlua + run: | + cd lua-http + tlc -o /dev/null spec/require-all.lua diff --git a/README.md b/README.md index dbf98834..8f59b111 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Can be found at [https://daurnimator.github.io/lua-http/](https://daurnimator.gi ## Status +![Build Status](https://github.com/daurnimator/lua-http/workflows/test/badge.svg) [![Build Status](https://travis-ci.org/daurnimator/lua-http.svg)](https://travis-ci.org/daurnimator/lua-http) [![Coverage Status](https://coveralls.io/repos/daurnimator/lua-http/badge.svg?branch=master&service=github)](https://coveralls.io/github/daurnimator/lua-http?branch=master) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/108/badge)](https://bestpractices.coreinfrastructure.org/projects/108)