Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/topaxi/pipeline.nvim
See status of ci/cd pipeline runs directly in neovim. Currently supports GitHub Actions and GitLab CI.
https://github.com/topaxi/pipeline.nvim
actions ci cicd github github-actions gitlab gitlab-ci lua neovim neovim-plugin nvim nvim-plugin
Last synced: 6 days ago
JSON representation
See status of ci/cd pipeline runs directly in neovim. Currently supports GitHub Actions and GitLab CI.
- Host: GitHub
- URL: https://github.com/topaxi/pipeline.nvim
- Owner: topaxi
- Created: 2023-03-30T15:02:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-04T20:50:42.000Z (18 days ago)
- Last Synced: 2024-12-08T13:45:41.621Z (14 days ago)
- Topics: actions, ci, cicd, github, github-actions, gitlab, gitlab-ci, lua, neovim, neovim-plugin, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 188 KB
- Stars: 138
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pipeline.nvim
The pipeline.nvim plugin for Neovim allows developers to easily manage and dispatch their CI/CD Pipelines, like GitHub Actions or Gitlab CI, directly from within the editor.
## CI/CD Platform Support
- [GitHub Actions](https://github.com/features/actions)
- [Gitlab CI/CD](https://docs.gitlab.com/ee/ci/) (fairly untested, feel free to
report bugs or open PRs)## Features
- List pipelines and their runs for the current repository
- Run/dispatch pipelines with `workflow_dispatch`## ToDo
- Rerun a failed pipeline or job
- Configurable keybindings
- Allow to cycle between inputs on dispatch## Installation
### Dependencies
Either have the cli [yq](https://github.com/mikefarah/yq) installed or:
- [GNU Make](https://www.gnu.org/software/make/)
- [Cargo](https://doc.rust-lang.org/cargo/)Additionally, the Gitlab provider needs the [`glab`](https://docs.gitlab.com/ee/editor_extensions/gitlab_cli/) cli to be installed.
### lazy.nvim
Using [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
'topaxi/pipeline.nvim',
keys = {
{ 'ci', 'Pipeline', desc = 'Open pipeline.nvim' },
},
-- optional, you can also install and use `yq` instead.
build = 'make',
---@type pipeline.Config
opts = {},
},
```## Authentication
### GitHub
The plugin requires authentication with your GitHub account to access your workflows and runs. You can authenticate by running the `gh auth login command` in your terminal and following the prompts.
Alternatively, define a `GITHUB_TOKEN` variable in your environment.
### Gitlab
The plugin interacts with Gitlab via the `glab` cli, all that is needed is being authenticated through `glab auth login`.
## Usage
### Commands
- `:Pipeline` or `:Pipeline toggle` toggles the `pipeline.nvim` split
- `:Pipeline open` opens the `pipeline.nvim` split
- `:Pipeline close` closes the `pipeline.nvim` split### Keybindings
The following keybindings are provided by the plugin:
- `q` - closes the `pipeline.nvim` the split
- `gp` - open the pipeline below the cursor on GitHub
- `gr` - open the run below the cursor on GitHub
- `gj` - open the job of the workflow run below the cursor on GitHub
- `d` - dispatch a new run for the workflow below the cursor on GitHub### Options
The default options (as defined in [lua/config.lua](./blob/main/lua/pipeline/config.lua))
```lua
{
--- The browser executable path to open workflow runs/jobs in
browser = nil,
--- Interval to refresh in seconds
refresh_interval = 10,
--- How much workflow runs and jobs should be indented
indent = 2,
providers = {
github = {},
gitlab = {},
},
--- Allowed hosts to fetch data from, github.com is always allowed
allowed_hosts = {},
icons = {
workflow_dispatch = '⚡️',
conclusion = {
success = '✓',
failure = 'X',
startup_failure = 'X',
cancelled = '⊘',
skipped = '◌',
},
status = {
unknown = '?',
pending = '○',
queued = '○',
requested = '○',
waiting = '○',
in_progress = '●',
},
},
highlights = {
PipelineRunIconSuccess = { link = 'LspDiagnosticsVirtualTextHint' },
PipelineRunIconFailure = { link = 'LspDiagnosticsVirtualTextError' },
PipelineRunIconStartup_failure = { link = 'LspDiagnosticsVirtualTextError' },
PipelineRunIconPending = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconRequested = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconWaiting = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconIn_progress = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconCancelled = { link = 'Comment' },
PipelineRunIconSkipped = { link = 'Comment' },
PipelineRunCancelled = { link = 'Comment' },
PipelineRunSkipped = { link = 'Comment' },
PipelineJobCancelled = { link = 'Comment' },
PipelineJobSkipped = { link = 'Comment' },
PipelineStepCancelled = { link = 'Comment' },
PipelineStepSkipped = { link = 'Comment' },
},
split = {
relative = 'editor',
position = 'right',
size = 60,
win_options = {
wrap = false,
number = false,
foldlevel = nil,
foldcolumn = '0',
cursorcolumn = false,
signcolumn = 'no',
},
},
}```
## lualine integration
```lua
require('lualine').setup({
sections = {
lualine_a = {
{ 'pipeline' },
},
}
})
```or with options:
```lua
require('lualine').setup({
sections = {
lualine_a = {
-- with default options
{ 'pipeline', icon = '' },
},
}
})
```## Credits
- [folke/lazy.nvim](https://github.com/folke/lazy.nvim) for the rendering approach