-
Notifications
You must be signed in to change notification settings - Fork 25
57 lines (56 loc) · 1.54 KB
/
zsh-n.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
name: "✅ Zsh"
on:
push:
paths:
- "**/*.ch"
- "**/*.zsh"
- "tests/*"
- "share/*"
- "themes/*"
- "functions/*"
pull_request:
paths:
- "**/*.ch"
- "**/*.zsh"
- "tests/*"
- "share/*"
- "themes/*"
- "functions/*"
workflow_dispatch: {}
jobs:
zsh-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4
- name: "⚡ Set matrix output"
id: set-matrix
run: |
MATRIX="$(find . -type d -name 'doc' -prune -o -type f \( -iname '*.zsh' -o -iname '*.ch' -o -iname 'fast-*' \) -print | jq -ncR '{"include": [{"file": inputs}]}')"
echo "MATRIX=${MATRIX}" >&2
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
zsh-n:
runs-on: ubuntu-latest
needs: zsh-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.zsh-matrix.outputs.matrix) }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4
- name: "⚡ Install dependencies"
run: sudo apt update && sudo apt-get install -yq zsh
- name: "⚡ zsh -n: ${{ matrix.file }}"
env:
ZSH_FILE: ${{ matrix.file }}
run: |
zsh -n "${ZSH_FILE}"
- name: "⚡ zcompile ${{ matrix.file }}"
env:
ZSH_FILE: ${{ matrix.file }}
run: |
zsh -fc "zcompile ${ZSH_FILE}"; rc=$?
ls -al "${ZSH_FILE}.zwc"; exit "$rc"