From 908051e6f603082e072e300b4516b45b3a7ce8fe Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Tue, 10 Sep 2024 07:10:10 +0200 Subject: [PATCH] feat: `before` input --- README.md | 10 ++++++++-- action.yml | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4037cb4..8e46a0b 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ busted --lua nlua spec/mytest_spec.lua ## Inputs -### `nvim_version` +### `nvim_version` (optional) Version of Neovim to install. Valid values are `stable`, `nightly` or version tag such as `v0.9.2`. @@ -92,7 +92,7 @@ as `v0.9.2`. > This value must exactly match to a tag name > when installing the specific version. -### `luarocks_version` +### `luarocks_version` (optional) Version of LuaRocks[^2] to install. @@ -101,6 +101,12 @@ Version of LuaRocks[^2] to install. [^2]: This action uses [LuaRocks](https://luarocks.org/) to install `busted` and test dependencies. +### `before` (optional) + +A bash script to run before running the tests. +For example, you can use this to install additional luarocks packages +that can't be installed automatically using `luarocks test`. + ## Resources - [`nvim-lua/nvim-lua-plugin-template`](https://github.com/nvim-lua/nvim-lua-plugin-template/) diff --git a/action.yml b/action.yml index c4ebc80..c6feefc 100644 --- a/action.yml +++ b/action.yml @@ -14,9 +14,13 @@ inputs: required: false default: 'stable' luarocks_version: - description: 'Version of LuaRocks to install.' + description: Version of LuaRocks to install. required: false default: '3.11.1' + before: + description: Script to run before running tests. + required: false + default: '' runs: using: "composite" steps: @@ -57,6 +61,11 @@ runs: with: luarocksVersion: ${{ inputs.luarocks_version }} + - name: Run 'before' script + if: ${{ inputs.before != '' }} + run: ${{ inputs.before }} + shell: bash + - name: Install busted and nlua if: steps.cache-luarocks.outputs.cache-hit != 'true' run: |