ci: modernize GitHub Actions — remove bots, SHA-pin, add zd test #341
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| 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: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| zsh-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - name: ⤵️ Check out code from GitHub | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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" |