-
Notifications
You must be signed in to change notification settings - Fork 42
60 lines (58 loc) · 1.52 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
58
59
60
---
name: "✅ Zsh"
on:
push:
tags: ["v*.*.*"]
branches:
- main
- next
paths:
- "zi.zsh"
- "lib/**"
pull_request:
paths:
- "zi.zsh"
- "lib/**"
workflow_run:
workflows:
- "⭕ Trunk"
types:
- completed
branches: [main]
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@v3
- name: "Set matrix output"
id: set-matrix
run: |
MATRIX="$(find . -type d -name 'doc' -prune -o -type f \( -iname '*.zsh' -o -iname '_zi' \) -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@v3
- 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"