diff --git a/.github/workflows/busted.yml b/.github/workflows/busted.yml index d4189e9..aace5b3 100644 --- a/.github/workflows/busted.yml +++ b/.github/workflows/busted.yml @@ -28,7 +28,7 @@ jobs: luarocks install busted luarocks install dkjson luarocks install inifile - luarocks install yaml + ${{ matrix.luaVersion != '5.4' && 'luarocks install yaml' || '' }} # https://github.com/lubyk/yaml/issues/7 - name: Replace system cliargs with self run: | diff --git a/spec/config_loader_spec.lua b/spec/config_loader_spec.lua index 4414f0a..7b0ddb5 100644 --- a/spec/config_loader_spec.lua +++ b/spec/config_loader_spec.lua @@ -39,9 +39,14 @@ describe("cliargs.config_loader", function() end) describe('#from_yaml', function() - it('works', function() - args, err = cli:parse({ '--config', 'spec/fixtures/config.yml' }) - end) + -- Because it isn't easy to install on Lua 5.4, some environments can't run this test + -- https://github.com/lubyk/yaml/issues/7 + local hasyaml = pcall(require, "yaml") + if hasyaml then + it('works', function() + args, err = cli:parse({ '--config', 'spec/fixtures/config.yml' }) + end) + end end) describe('#from_lua', function()