diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..883f36d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: master + pull_request: + branches: '*' + +jobs: + ci: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + luaVersion: ["5.1", "5.2", "5.3", "5.4", "5.5", "luajit", "luajit-openresty"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + + steps: + - uses: actions/checkout@master + + - uses: ilammy/msvc-dev-cmd@v1 + if: ${{ runner.os == 'Windows' && !startsWith(matrix.luaVersion, 'luajit') }} + + - uses: luarocks/gh-actions-lua@master + with: + luaVersion: ${{ matrix.luaVersion }} + + - uses: luarocks/gh-actions-luarocks@master + + - name: Lint development rockspec + run: luarocks lint "argparse-scm-2.rockspec" + + - name: Install busted + run: luarocks install busted + + - name: Install cluacov + run: luarocks install cluacov + + - name: Install luacheck + run: luarocks install luacheck + + - name: Run luacheck + run: luacheck src spec + + - name: Run tests + run: busted -c + + - name: Run code coverage + run: luacov + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2e743ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: python -sudo: false - -env: - - LUA="lua 5.1" - - LUA="lua 5.2" - - LUA="lua 5.3" - - LUA="luajit 2.0" - - LUA="luajit 2.1" - -before_install: - - pip install codecov - - pip install hererocks - - hererocks lua_install --$LUA -r latest - - source lua_install/bin/activate - - luarocks install busted - - luarocks install cluacov - - luarocks install luacheck - -install: - - luarocks make - -script: - - luacheck src spec - - busted -c - -after_script: - - luacov - - codecov -X gcov diff --git a/README.md b/README.md index b5a7f32..b998124 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # argparse -[![Build Status](https://travis-ci.org/luarocks/argparse.png?branch=master)](https://travis-ci.org/luarocks/argparse) +[![CI](https://github.com/luarocks/argparse/actions/workflows/ci.yml/badge.svg)](./.github/workflows/ci.yml) [![Coverage status](https://codecov.io/gh/luarocks/argparse/branch/master/graph/badge.svg)](https://codecov.io/gh/luarocks/argparse) Argparse is a feature-rich command line parser for Lua inspired by argparse for Python. @@ -104,7 +104,7 @@ Did you mean '--output'? ### Using LuaRocks -Installing argparse using [LuaRocks](http://luarocks.org) is simple: +Installing argparse using [LuaRocks](https://luarocks.org) is simple: ```bash $ luarocks install argparse @@ -122,7 +122,7 @@ Tutorial HTML files can be built using [Sphinx](http://sphinx-doc.org/): `sphinx ## Testing -argparse comes with a testing suite located in `spec` directory. [busted](http://olivinelabs.com/busted/) is required for testing, it can be installed using LuaRocks. Run the tests using `busted` command from the argparse folder. +argparse comes with a testing suite located in `spec` directory. [busted](https://github.com/lunarmodules/busted) is required for testing, it can be installed using LuaRocks. Run the tests using `busted` command from the argparse folder. ## License