From 9e22f32dd442d7c95766aca54ceea9833efa4f9d Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 17 Feb 2022 01:14:56 -0300 Subject: tests: remove Travis CI, add Github Actions --- .github/workflows/test.yml | 104 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/test.yml (limited to '.github') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..3ddd5f18 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,104 @@ +name: test + +on: [push] + +jobs: + ############################################################################## + ShellLint: + runs-on: "ubuntu-latest" + + steps: + - uses: actions/checkout@master + + - name: Prep + run: | + sudo apt-get install -y shellcheck + + - name: Shellcheck + run: | + shellcheck ./configure + + ############################################################################## + LuaLint: + runs-on: "ubuntu-latest" + + steps: + - uses: actions/checkout@master + + - uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: "5.4" + + - uses: leafo/gh-actions-luarocks@v4.0.0 + + - name: Prep + run: | + luarocks install luacheck + + - name: Luacheck + run: | + luacheck . + + ############################################################################## + TestMatrix: + strategy: + matrix: + lua-version: ["5.3", "luajit"] + os: ["ubuntu-latest", "macos-latest"] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@master + + - uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: ${{ matrix.lua-version }} + + - uses: leafo/gh-actions-luarocks@v4.0.0 + + - name: Prep + run: | + luarocks install busted + luarocks install cluacov + luarocks install luacheck + luarocks install busted-htest + + - name: Luacheck + run: | + luacheck . + + - name: Unit Test + run: | + eval $(luarocks path) + busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci" + busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci,env=full" + + - name: Integration Test + run: | + eval $(luarocks path) + busted -o htest --exclude-tags=ssh,gpg,git,unit --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci" + busted -o htest --exclude-tags=ssh,gpg,git,unit --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci,env=full" + + - name: Coverage + run: | + eval $(luarocks path) + luacov -c testrun/luacov.config + ( cd testrun/ && bash <(curl -s https://codecov.io/bash) ) + grep "Summary" -B1 -A1000 testrun/luacov.report.out + + ############################################################################## + SmokeTest: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@master + + - uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: "5.3" + + - name: Smoke Test + run: | + ./configure + ./makedist dev + ./smoke_test.sh luarocks-dev.tar.gz + -- cgit v1.2.3-55-g6feb