From ccc26a5d80e5c6b6534e7c3c773bbc6388bbd2fc Mon Sep 17 00:00:00 2001 From: SX <50966843+S-S-X@users.noreply.github.com> Date: Tue, 23 Feb 2021 14:10:13 +0200 Subject: [PATCH] Add simple initialization test (#15) * Add simple initialization test * Exclude spec from luacheck Co-authored-by: SX --- .github/workflows/mineunit.yml | 22 ++++++++++++++++++++++ .luacheckrc | 4 ++++ spec/fixtures/digilines.lua | 1 + spec/init_spec.lua | 13 +++++++++++++ spec/mineunit.conf | 1 + 5 files changed, 41 insertions(+) create mode 100644 .github/workflows/mineunit.yml create mode 100644 spec/fixtures/digilines.lua create mode 100644 spec/init_spec.lua create mode 100644 spec/mineunit.conf diff --git a/.github/workflows/mineunit.yml b/.github/workflows/mineunit.yml new file mode 100644 index 0000000..e8b90b7 --- /dev/null +++ b/.github/workflows/mineunit.yml @@ -0,0 +1,22 @@ + +name: mineunit + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: mineunit + uses: mt-mods/mineunit-actions@master + with: + badge-label: Test coverage +# Uncomment to add coverage badge for regression tests +# - uses: RubbaBoy/BYOB@v1.2.0 +# with: +# NAME: "${{ steps.mineunit.outputs.badge-name }}" +# LABEL: "${{ steps.mineunit.outputs.badge-label }}" +# STATUS: "${{ steps.mineunit.outputs.badge-status }}" +# COLOR: "${{ steps.mineunit.outputs.badge-color }}" +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.luacheckrc b/.luacheckrc index ecf6989..b0dfdae 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -20,3 +20,7 @@ read_globals = { "mesecon", "screwdriver", } + +exclude_files = { + "**/spec/**", +} diff --git a/spec/fixtures/digilines.lua b/spec/fixtures/digilines.lua new file mode 100644 index 0000000..50159cf --- /dev/null +++ b/spec/fixtures/digilines.lua @@ -0,0 +1 @@ +digilines = {} diff --git a/spec/init_spec.lua b/spec/init_spec.lua new file mode 100644 index 0000000..5c5b336 --- /dev/null +++ b/spec/init_spec.lua @@ -0,0 +1,13 @@ +require("mineunit") + +mineunit("core") + +fixture("digilines") + +describe("Digistuff mod initialization", function() + + it("will not fail", function() + sourcefile("init") + end) + +end) diff --git a/spec/mineunit.conf b/spec/mineunit.conf new file mode 100644 index 0000000..f13ebf0 --- /dev/null +++ b/spec/mineunit.conf @@ -0,0 +1 @@ +modname = "digistuff"