From 478402dda959e12dd0c2d6ae3e006bf2ca856b29 Mon Sep 17 00:00:00 2001 From: David Leal Date: Thu, 31 Aug 2023 12:50:04 -0600 Subject: [PATCH] Replace Travis CI with GitHub Actions (#12) --- .github/workflows/build.yml | 20 ++++++++++++++++++++ .travis.yml | 16 ---------------- init.lua | 3 ++- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..503517a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: build +on: [push, pull_request] + +jobs: + luacheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -qqq luarocks + - name: Install LuaCheck and pre-commit + run: | + pip3 install pre-commit + luarocks install --local luacheck + - name: Run LuaCheck with pre-commit + run: | + export PATH="$HOME/.luarocks/bin:$PATH" + pre-commit run --all-files diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 32a776a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -dist: bionic -language: python - -python: - - 3.7.1 - -install: - - sudo apt-get update -qq - - sudo apt-get install -qqq luarocks - - pip3 install pre-commit - - luarocks install --local luacheck - -script: - # All linters are run with pre-commit hooks - - export PATH="$HOME/.luarocks/bin:$PATH" - - pre-commit run --all-files diff --git a/init.lua b/init.lua index da4a456..d255d56 100644 --- a/init.lua +++ b/init.lua @@ -35,7 +35,8 @@ local function add_gauge(player) end end --- credit: https://github.com/minetest/minetest/blob/6de8d77e17017cd5cc7b065d42566b6b1cd076cc/builtin/game/statbars.lua#L30-L37 +-- credit: +-- https://github.com/minetest/minetest/blob/master/builtin/game/statbars.lua#L31-L37 local function scaleToDefault(player, field) -- Scale "hp" or "breath" to supported amount local current = player["get_" .. field](player)