Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: adding test over selected plugins #13

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
deps: [ [ "toto", "toto2" ], ["tata", "tata2" ] ]
# if: github.event.pull_request.draft == false
plugin: [
{
"name": "startup-nvim/startup.nvim",
"shorthand": "startup.nvim",
"license": "GPL-2.0",
"summary": "A highly configurable neovim startup screen",
"dependencies": ["telescope.nvim", "plenary.nvim"]
}
]

steps:
- name: Install Lua
Expand All @@ -21,3 +28,43 @@ jobs:
- name: test concat
run: |
echo ${{ join (matrix.deps, '\n')}}

- name: Checkout plugin repository
uses: actions/checkout@v4
with:
repository: ${{ matrix.plugin.name }}
ref: ${{ matrix.plugin.ref }}
path: .

- run: |
echo "GITHUB_REPOSITORY_OVERRIDE=${{ matrix.plugin.name }}" >> $GITHUB_ENV
echo "GITHUB_SHA_OVERRIDE=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Convert JSON list to multiline string
id: convert
run: |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
{
echo "multiline<<EOF"
echo -e "${{ join(matrix.plugin.dependencies, '\n') }}"
echo EOF
} >> "$GITHUB_OUTPUT"

- name: Publish Development LuaRock
uses: nvim-neorocks/luarocks-tag-release@v7
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
name: ${{ matrix.plugin.shorthand }}
dependencies: ${{ steps.convert.outputs.multiline }}
version: "scm"
summary: ${{ matrix.plugin.summary }}
license: ${{ matrix.plugin.license }}
labels: neovim
copy_directories: |
{{ neovim.plugin.dirs }}
${{ matrix.plugin.extra_directories }}
extra_luarocks_args: |
--namespace=neorocks
--force
--dev
12 changes: 11 additions & 1 deletion .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@ jobs:
echo "GITHUB_REPOSITORY_OVERRIDE=${{ matrix.plugin.name }}" >> $GITHUB_ENV
echo "GITHUB_SHA_OVERRIDE=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Convert JSON list to multiline string
id: convert
run: |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
{
echo "multiline<<EOF"
echo -e "${{ join(matrix.plugin.dependencies, '\n') }}"
echo EOF
} >> "$GITHUB_OUTPUT"

- name: Publish Development LuaRock
uses: nvim-neorocks/luarocks-tag-release@v7
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
name: ${{ matrix.plugin.shorthand }}
dependencies: ${{ join(matrix.plugin.dependencies, '\n') }}
dependencies: ${{ steps.convert.outputs.multiline }}
version: "scm"
summary: ${{ matrix.plugin.summary }}
license: ${{ matrix.plugin.license }}
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,24 @@ jobs:
run: |
echo "PUBLISHED_COUNT=$(luarocks --only-server=https://luarocks.org/manifests/neorocks search ${{ matrix.plugin.shorthand }} ${{ env.RELEASE_VERSION }} --porcelain | wc -l)" >> $GITHUB_ENV

- name: Convert JSON list to multiline string
id: convert
run: |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
{
echo "multiline<<EOF"
echo -e "${{ join(matrix.plugin.dependencies, '\n') }}"
echo EOF
} >> "$GITHUB_OUTPUT"

- name: Publish LuaRock
uses: nvim-neorocks/luarocks-tag-release@v7
if: ${{ env.PUBLISHED_COUNT == '0' }}
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
name: ${{ matrix.plugin.shorthand }}
dependencies: ${{ join(matrix.plugin.dependencies, '\n') }}
dependencies: ${{ steps.convert.outputs.multiline }}
version: ${{ env.RELEASE_VERSION }}
summary: ${{ matrix.plugin.summary }}
license: ${{ matrix.plugin.license }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ which uses the chunk it receives as the input for a matrix build.

- `name`: owner/repo (GitHub)
- `shorthand`: The name of the plugin (will be the lua rock name)
- `dependencies`: Plugin dependencies, separated with newline `\n` characters
- `dependencies`: Plugin dependencies, a list of luarocks plugins
- `summary`: Short description of the plugin
- `license`: The license SPDX
- `extra_directories`: (optional) Extra directories to copy, separated by `\n`,
Expand Down