From 2c8ef11d1dba8a1cc7685b899e4649b3ebb3012a Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 18:47:58 +0100 Subject: [PATCH 01/11] ci: use busted 2.1.2 --- .github/workflows/spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 41bea59..625f2e3 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -27,7 +27,7 @@ jobs: python -m pip install hererocks python -m hererocks lua_install --${{ matrix.lua }} -rlatest . lua_install/bin/activate - luarocks install busted + luarocks install busted 2.1.2 - name: Build run: | From b91dc3e667567648dedea981a425bfac9dfaba54 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 18:50:33 +0100 Subject: [PATCH 02/11] ci: enable spec.yml for pull_request --- .github/workflows/spec.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 625f2e3..09b381b 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -1,6 +1,8 @@ name: build -on: [push] +on: + push: + pull_request: jobs: build: From 95f994c5624e51f153fea199a3385832d1cfa5f6 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 18:55:12 +0100 Subject: [PATCH 03/11] ci: unpin busted + install LuaFileSystem --- .github/workflows/spec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 09b381b..cad306f 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -29,7 +29,8 @@ jobs: python -m pip install hererocks python -m hererocks lua_install --${{ matrix.lua }} -rlatest . lua_install/bin/activate - luarocks install busted 2.1.2 + luarocks install LuaFileSystem + luarocks install busted - name: Build run: | From e2dd8346cd199fde489c98ec7bb6555e706f7ebf Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 19:01:41 +0100 Subject: [PATCH 04/11] ci: invoke busted directly --- .github/workflows/spec.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index cad306f..2bb8e63 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -29,7 +29,6 @@ jobs: python -m pip install hererocks python -m hererocks lua_install --${{ matrix.lua }} -rlatest . lua_install/bin/activate - luarocks install LuaFileSystem luarocks install busted - name: Build @@ -40,4 +39,4 @@ jobs: - name: Test run: | . lua_install/bin/activate - luarocks test + busted test/fzy_spec.lua From 8f76f500981b9cc0809e14dc1baf642684b64567 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 19:07:19 +0100 Subject: [PATCH 05/11] tests: simplify .busted --- .busted | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.busted b/.busted index 7e15f00..eb98e22 100644 --- a/.busted +++ b/.busted @@ -1,13 +1,6 @@ return { - _all = { - coverage = false, - lpath = "src/?.lua;src/?/init.lua", - }, default = { verbose = true, ROOT = {"test"}, }, - tests = { - verbose = true, - }, } From 5d43749c6fdbf28c75c298d121e708a9931403de Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 19:26:44 +0100 Subject: [PATCH 06/11] ci: replace hererocks with lua/luarocks github actions --- .github/workflows/spec.yml | 31 +++++++++++++++---------------- src/match.c | 2 -- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 2bb8e63..6d52f69 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -11,32 +11,31 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - lua: ["lua 5.1", "lua 5.2", "lua 5.3", "lua 5.4", "luajit 2.1"] + lua: ["5.1", "5.2", "5.3", "5.4", "luajit-2.1.0-beta3"] steps: - uses: actions/checkout@v3 - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' + - name: Install MSVC Compiler Toolchain + uses: ilammy/msvc-dev-cmd@v1 + if: runner.os == 'Windows' - name: Install Lua - env: - # luajit fails to build on macos without this - MACOSX_DEPLOYMENT_TARGET: "10.15" - run: | - python -m pip install hererocks - python -m hererocks lua_install --${{ matrix.lua }} -rlatest - . lua_install/bin/activate - luarocks install busted + uses: leafo/gh-actions-lua@v10 + with: + luaVersion: ${{ matrix.lua }} + + - name: Install Luarocks + # NOTE: This is a fork with Windows support + uses: hishamhm/gh-actions-luarocks@master - name: Build run: | - . lua_install/bin/activate luarocks make - name: Test run: | - . lua_install/bin/activate - busted test/fzy_spec.lua + luarocks test + # FIXME: There seems to be a bug causing busted + # to fail on Windows, because it can't find LuaFileSystem + if: runner.os ~= 'Windows' diff --git a/src/match.c b/src/match.c index 01ce2be..cfc05aa 100644 --- a/src/match.c +++ b/src/match.c @@ -15,8 +15,6 @@ #include #include #include -#include - #include "bonus.h" From 02f62a41998ac9c4e85c74ef8d4808911458710f Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 20:45:40 +0100 Subject: [PATCH 07/11] Fix workflow expression --- .github/workflows/spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 6d52f69..deca6aa 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -38,4 +38,4 @@ jobs: luarocks test # FIXME: There seems to be a bug causing busted # to fail on Windows, because it can't find LuaFileSystem - if: runner.os ~= 'Windows' + if: runner.os != 'Windows' From d5f887845c501f41e66d1a02786a23bc70f950f7 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 20:55:13 +0100 Subject: [PATCH 08/11] Use latest luajit --- .github/workflows/spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index deca6aa..290a640 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - lua: ["5.1", "5.2", "5.3", "5.4", "luajit-2.1.0-beta3"] + lua: ["5.1", "5.2", "5.3", "5.4", "luajit"] steps: - uses: actions/checkout@v3 From 8ffd2ed3b412fcac957478a62bc59fc1634bc286 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 20:59:36 +0100 Subject: [PATCH 09/11] Exclude windows/luajit --- .github/workflows/spec.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 290a640..6465421 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -12,6 +12,9 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] lua: ["5.1", "5.2", "5.3", "5.4", "luajit"] + exclude: + - lua: juajit + os: windows-latest steps: - uses: actions/checkout@v3 From 4598e0581281f5e283c5169f4b5f39e88b90cc6e Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 21:00:07 +0100 Subject: [PATCH 10/11] Typo --- .github/workflows/spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 6465421..f1db4a5 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -13,7 +13,7 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] lua: ["5.1", "5.2", "5.3", "5.4", "luajit"] exclude: - - lua: juajit + - lua: luajit os: windows-latest steps: From 2f8805590f551df54d6f7303956fca206c35c010 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 4 Dec 2023 21:03:21 +0100 Subject: [PATCH 11/11] Fix indent --- .github/workflows/spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index f1db4a5..e1ec0c8 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -12,7 +12,7 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] lua: ["5.1", "5.2", "5.3", "5.4", "luajit"] - exclude: + exclude: - lua: luajit os: windows-latest