Skip to content

Commit

Permalink
feat!: drop support for running tests in favour of nvim-busted-action (
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Jun 21, 2024
1 parent 00468ee commit 2af6c3a
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 550 deletions.
65 changes: 12 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ No need to add a rockspec to your repository for each release (or at all).
- Tests a local installation from the rockspec file before uploading.
- Uploads the package to LuaRocks.
- Tests the installation of the uploaded package.
- Runs [`luarocks test`](https://github.com/luarocks/luarocks/wiki/test)
with lua, neovim 0.9 and/or neovim-nightly as the interpreter.

## Prerequisites

Expand All @@ -75,14 +73,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
```
> [!NOTE]
>
> Use the `v6` tag to keep up with the latest releases, without breaking changes.
> Use the `v7` tag to keep up with the latest releases, without breaking changes.

## Inputs

Expand All @@ -103,7 +101,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
dependencies: |
plenary.nvim
Expand All @@ -119,7 +117,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
test_dependencies: |
luaunit
Expand All @@ -134,51 +132,12 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
labels: |
neovim
```

### `test_interpreters`

> [!WARNING]
>
> DEPRECATED! Use [nvim-busted-action](https://github.com/marketplace/actions/nvim-busted-action)
> or [lua-busted](https://github.com/marketplace/actions/lua-busted) for tests instead!
>
> This will be removed completely in a later release.

Lua interpreters to run `luarocks test` with.
If set to an empty string (default), or no [.busted file](https://lunarmodules.github.io/busted/#usage)
is present, no tests will be run.

Supported interpreters:

- `neovim-stable` - With access to the [Neovim 0.9 Lua API](https://neovim.io/doc/user/lua.html).
- `neovim-nightly` - With access to the Neovim nightly Lua API.
- `lua` - Plain luajit

Example:

```yaml
- name: LuaRocks Test and Upload
uses: nvim-neorocks/luarocks-tag-release@v6
with:
test_interpreters: |
neovim-stable
neovim-nightly
```

> [!NOTE]
>
> For reproducible builds with recent versions of Neovim,
> we recommend **not** to use the latest stable tag,
> but instead to use [Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates#enabling-github-dependabot-version-updates)
> to manage version updates.
> For convenience, you can [auto-approve](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request)
> the pull request.

### `copy_directories`

Directories in the source directory to be copied to the rock installation
Expand All @@ -189,7 +148,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
copy_directories: |
{{ neovim.plugin.dirs }}
Expand Down Expand Up @@ -243,7 +202,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
detailed_description: |
Publishes packages to LuaRocks when a git tag is pushed.
Expand All @@ -262,7 +221,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
template: "/path/to/my/template.rockspec"
```
Expand All @@ -277,7 +236,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
license: "MIT"
```
Expand Down Expand Up @@ -326,7 +285,7 @@ jobs:
- name: Get new commits
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
Expand Down Expand Up @@ -355,7 +314,7 @@ Example:

```yaml
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
version: "scm"
# Add logic or determining if the specrev needs to be incremented
Expand All @@ -379,7 +338,7 @@ Example:
- run: |
sudo apt-get install -y libcurl4-openssl-dev
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v6
uses: nvim-neorocks/luarocks-tag-release@v7
with:
extra_luarocks_args: |
CURL_INCDIR=/usr/include/x86_64-linux-gnu
Expand Down
6 changes: 0 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ inputs:
But sometimes, GitHub does not recognise it,
in which case LuaRocks will fall back to this one.
required: false
test_interpreters:
description: |
DEPRECATED! Use nvim-neorocks/nvim-busted-action for tests instead!
required: false
default: ""
extra_luarocks_args:
description: |
Extra args to pass to the luarocks command.
Expand Down Expand Up @@ -90,7 +85,6 @@ runs:
INPUT_DETAILED_DESCRIPTION: ${{ inputs.detailed_description }}
INPUT_TEMPLATE: ${{ inputs.template }}
INPUT_LICENSE: ${{ inputs.license }}
INPUT_TEST_INTERPRETERS: ${{ inputs.test_interpreters }}
INPUT_EXTRA_LUAROCKS_ARGS: ${{ inputs.extra_luarocks_args }}
INPUT_FAIL_ON_DUPLICATE: ${{ inputs.fail_on_duplicate }}
RUNNER_DEBUG: ${{ runner.debug }}
Expand Down
12 changes: 0 additions & 12 deletions bin/luarocks-tag-release-action.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ local package_name = getenv_or_err('INPUT_NAME')
---@type string | nil
local package_version = is_pull_request and '0.0.0' or os.getenv('INPUT_VERSION')

local interpreters_input = os.getenv('INPUT_TEST_INTERPRETERS')
if interpreters_input ~= '' then
print([[
WARNING: The test_interpreters input is deprecated and will be removed in a later release.
Use nvim-neorocks/nvim-busted-action or lua-busted instead.
- https://github.com/marketplace/actions/nvim-busted-action
- https://github.com/marketplace/actions/lua-busted
]])
end
local test_interpreters = Parser.parse_interpreter_input(interpreters_input)

---@type Args
local args = {
github_repo = github_repo,
Expand All @@ -61,7 +50,6 @@ local args = {
or action_path .. '/resources/rockspec.template',
upload = not is_pull_request,
license = license_input ~= '' and license_input or nil,
luarocks_test_interpreters = test_interpreters,
extra_luarocks_args = Parser.parse_list_args(getenv_or_empty('INPUT_EXTRA_LUAROCKS_ARGS')),
github_event_path = getenv_or_err('GITHUB_EVENT_PATH'),
ref_type = os.getenv('GITHUB_REF_TYPE_OVERRIDE') or getenv_or_err('GITHUB_REF_TYPE'),
Expand Down
Loading

0 comments on commit 2af6c3a

Please sign in to comment.