Skip to content

Commit

Permalink
Merge pull request #3 from zdharma-continuum/ci/gh-action-lint-workflow
Browse files Browse the repository at this point in the history
feat: add lint gh action workflows
  • Loading branch information
vladdoster authored Apr 16, 2023
2 parents 51b3640 + 5466b3a commit 2d4c87c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint

on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
tags: ["v*.*.*"]
workflow_dispatch:

jobs:
commit:
uses: zdharma-continuum/.github/.github/workflows/commit-job.yml@main
lint:
uses: zdharma-continuum/.github/.github/workflows/lint-job.yml@main
52 changes: 20 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ To run the test, execute:
./run.zsh
```

However, there are problems with `zplug` when running the test this way – the
test hangs with a message:
However, there are problems with `zplug` when running the test this way – the test hangs with a message:

```
zsh: suspended (tty input) ./run.zsh
Expand Down Expand Up @@ -72,12 +71,10 @@ zdharma-continuum/zunit
zsh-users/zsh-autosuggestions
```

Some of the plugins are relatively regular `Makefile`-based projects, like
`arzzen/git-quick-stats.git`. The `atclone''`, `make''`, ice modifiers of
Zinit and the `hook-build` tag of Zplug allow to install and use them. However
they're problematic with `zgen`, which doesn't have such hooks. For it, instead
an empty plugin [zdharma/null](https://github.com/zdharma/null) is being loaded
in a following way:
Some of the plugins are relatively regular `Makefile`-based projects, like `arzzen/git-quick-stats.git`. The
`atclone''`, `make''`, ice modifiers of Zinit and the `hook-build` tag of Zplug allow to install and use them. However
they're problematic with `zgen`, which doesn't have such hooks. For it, instead an empty plugin
[zdharma/null](https://github.com/zdharma/null) is being loaded in a following way:

```zsh
# git-recall
Expand All @@ -89,33 +86,26 @@ zgen load zdharma-continuum/null null.plugin.zsh empty-plugin.zsh-13
zgen load zdharma-continuum/null null.plugin.zsh empty-plugin.zsh-14
```

the `empty-plugin.zsh-14`, etc. is a branch. The file `null.plugin.zsh` contains
only 3 instructions:
the `empty-plugin.zsh-14`, etc. is a branch. The file `null.plugin.zsh` contains only 3 instructions:

```zsh
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"
true
```

This way, a little balance is introduced into the test and creates a good
minimum for the comparison – to have `zgen` only clone and load an almost empty
plugin instead of setting up a `PATH` for a command-like plugin, especially
because of the way that `zgen` works – by storing plain `source` commands and
not executing any code.
This way, a little balance is introduced into the test and creates a good minimum for the comparison – to have `zgen`
only clone and load an almost empty plugin instead of setting up a `PATH` for a command-like plugin, especially because
of the way that `zgen` works – by storing plain `source` commands and not executing any code.

However, it puts `zgen` in a better position because it has to
clone an almost empty repository and not a complete project, so the
installation-time test is biased. However, it's hard to address this without
simplifying the test because of limited `zgen` functionality. Also, `zgen`
doesn't run the compilation (i.e. `make`) during the installation of the
plugins.
However, it puts `zgen` in a better position because it has to clone an almost empty repository and not a complete
project, so the installation-time test is biased. However, it's hard to address this without simplifying the test
because of limited `zgen` functionality. Also, `zgen` doesn't run the compilation (i.e. `make`) during the installation
of the plugins.

Zplug and Zinit tests are relatively identical
([zshrc](https://github.com/zdharma/pm-perf-test/blob/master/zplug/.zshrc) for
Zplug,
[zshrc](https://github.com/zdharma/pm-perf-test/blob/master/zinit-load/.zshrc)
for Zinit).
([zshrc](https://github.com/zdharma/pm-perf-test/blob/master/zplug/.zshrc) for Zplug,
[zshrc](https://github.com/zdharma/pm-perf-test/blob/master/zinit-load/.zshrc) for Zinit).

## Results

Expand All @@ -127,12 +117,10 @@ for Zinit).

The three different Zinit results need explaining:

1. Zinit light – plugins are being loaded without tracking, i.e., cannot be
unloaded, and their reports are empty.
1. Zinit load – plugins are being loaded with tracking, i.e., are available for
unloading, and their report data is gathered (available through `zinit report {plugin-name}` command).
1. Zinit (Turbo) load – plugins are loaded with tracking **and in Turbo
mode** – i.e., in the background & after prompt – the shell is instantly ready to
use.
1. Zinit light – plugins are being loaded without tracking, i.e., cannot be unloaded, and their reports are empty.
1. Zinit load – plugins are being loaded with tracking, i.e., are available for unloading, and their report data is
gathered (available through `zinit report {plugin-name}` command).
1. Zinit (Turbo) load – plugins are loaded with tracking **and in Turbo mode** – i.e., in the background & after prompt
– the shell is instantly ready to use.

<!-- vim:set ft=markdown tw=80 autoindent: -->

0 comments on commit 2d4c87c

Please sign in to comment.