Skip to content

Enhance reusable Zsh CI workflow with fixes and improvements#428

Open
ss-o wants to merge 11 commits into
mainfrom
copilot/add-reusable-zsh-ci-workflow
Open

Enhance reusable Zsh CI workflow with fixes and improvements#428
ss-o wants to merge 11 commits into
mainfrom
copilot/add-reusable-zsh-ci-workflow

Conversation

@ss-o
Copy link
Copy Markdown
Member

@ss-o ss-o commented May 23, 2026

Summary

This pull request introduces a reusable GitHub Actions workflow for Zsh CI and updates the existing Zsh workflow to support reuse. The main goal is to standardize Zsh file validation and compilation across repositories by providing a reusable workflow component.

Workflow improvements:

  • Added a new reusable workflow .github/workflows/reusable-zsh-ci.yml that checks out code, installs Zsh, validates all .zsh files with zsh -n, and compiles them with zcompile. This workflow is designed to be called from other workflows or repositories.
  • Updated .github/workflows/zsh-n.yml to add workflow_call, enabling this workflow to be invoked by other workflows or repositories, increasing modularity and reusability.

Verification

Agent handoff

If this PR is unfinished, blocked, or expected to be resumed by another maintainer or LLM agent, include:

  • Status: In progress | Blocked | Ready for review | Complete
  • Current state:
  • Blockers:
  • Next steps:
  • Related tracker/issues:

If no handoff is needed, write: No handoff needed.

Copilot AI and others added 10 commits May 15, 2026 12:50
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sall <59910950+ss-o@users.noreply.github.com>
@ss-o ss-o marked this pull request as ready for review May 23, 2026 15:46
@ss-o ss-o requested a review from a team as a code owner May 23, 2026 15:46
Copilot AI review requested due to automatic review settings May 23, 2026 15:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve cross-repo reuse for Zsh CI by introducing a reusable workflow and making the existing zsh-n workflow callable via workflow_call.

Changes:

  • Added workflow_call trigger support to .github/workflows/zsh-n.yml.
  • Added a new reusable workflow .github/workflows/reusable-zsh-ci.yml to run zsh -n and zcompile across all *.zsh files.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
.github/workflows/zsh-n.yml Adds workflow_call so the existing per-file matrix syntax/compile workflow can be invoked as a reusable workflow.
.github/workflows/reusable-zsh-ci.yml Introduces a new reusable workflow that discovers *.zsh files, runs zsh -n, and compiles them with zcompile.

Comment thread .github/workflows/reusable-zsh-ci.yml
Comment thread .github/workflows/reusable-zsh-ci.yml Outdated
Comment on lines +4 to +10
"on":
workflow_call: {}

jobs:
zsh-ci:
runs-on: ubuntu-latest
steps:
Comment thread .github/workflows/reusable-zsh-ci.yml Outdated
---
name: Reusable Zsh CI

"on":
Comment thread .github/workflows/reusable-zsh-ci.yml
Comment thread .github/workflows/reusable-zsh-ci.yml
Comment thread .github/workflows/reusable-zsh-ci.yml Outdated
uses: actions/checkout@v4.2.2

- name: ⚡ Install Zsh
run: sudo apt update && sudo apt-get install -yq zsh
Comment on lines +9 to +44
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.2.2

- name: ⚡ Install Zsh
run: sudo apt update && sudo apt-get install -yq zsh

- name: ⚡ zsh -n on all .zsh files
run: |
set -euo pipefail
mapfile -d '' files < <(
find . -type d -name 'doc' -prune -o -type f -name '*.zsh' -print0
)
if [ "${#files[@]}" -eq 0 ]; then
echo "ERROR: No .zsh files found to validate." >&2
exit 1
fi
for file in "${files[@]}"; do
zsh -n "${file}"
done

- name: ⚡ zcompile all .zsh files
run: |
set -euo pipefail
mapfile -d '' files < <(
find . -type d -name 'doc' -prune -o -type f -name '*.zsh' -print0
)
if [ "${#files[@]}" -eq 0 ]; then
echo "ERROR: No .zsh files found to compile." >&2
exit 1
fi
for file in "${files[@]}"; do
zsh -fc 'zcompile -- "$1"' zsh "${file}"
ls -al "${file}.zwc"
done
- Unquote `on:` for consistency with other workflows
- Add workflow-level `permissions: {}` and job-level `permissions: contents: read`
- Add `concurrency:` block matching other repo workflows
- Pin actions/checkout to SHA de0fac2e (v6.0.2)
- Use apt-get consistently (drop bare `apt update`)
- Prune `.git/` in both find commands alongside `doc/`
- Change exit 1 on no .zsh files to no-op exit 0

Agent-Logs-Url: https://github.com/z-shell/.github/sessions/ba89a619-772a-4b3e-9e6c-57c215be60dc

Co-authored-by: ss-o <59910950+ss-o@users.noreply.github.com>
Copilot finished work on behalf of ss-o May 23, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants