diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index a78c3c3..389b72f 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,5 +1,11 @@ name: linters -on: [push, pull_request] + +on: + push: + branches: + - main + - develop + pull_request: jobs: linters: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 74a9d11..856e0f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,11 @@ name: tests -on: [push, pull_request] + +on: + push: + branches: + - main + - develop + pull_request: jobs: tests: @@ -19,6 +25,12 @@ jobs: - uses: actions/checkout@v3 + - name: Cache .tests + uses: actions/cache@v4 + with: + path: .tests + key: ${{ runner.os }}-tests-${{ hashFiles('.tests') }} + - name: Install NeoVim uses: rhysd/action-setup-vim@v1 with: diff --git a/spec/integration/struct_tags_test.lua b/spec/integration/struct_tags_test.lua new file mode 100644 index 0000000..9d09971 --- /dev/null +++ b/spec/integration/struct_tags_test.lua @@ -0,0 +1,9 @@ +local t = require "spec.testutils" + +local T = MiniTest.new_set {} +T["struct_tags"] = MiniTest.new_set {} +T["struct_tags"]["fuck it"] = function() + t.eq(1, 1) +end + +return T diff --git a/spec/testutils.lua b/spec/testutils.lua new file mode 100644 index 0000000..e931820 --- /dev/null +++ b/spec/testutils.lua @@ -0,0 +1,18 @@ +-- NOTE: there's a probably a better way to do this +local fixtures_dir = (vim.fn.expand "%:p:h") .. "/spec/fixtures/" + +---@class gopher.TestUtils +local testutils = {} + +---@generic T +---@param a T +---@param b T +---@return boolean +function testutils.eq(a, b) + return MiniTest.expect.equality(a, b) +end + +-- TODO: continue with writing fixtures helpers +-- https://github.com/olexsmir/gopher.nvim/pull/71/files + +return testutils