wip: Playing with github actions #4
This file contains 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
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
IMAGE_CACHE_PATH: /tmp/.image-cache | |
IMAGE_CACHE_NAME: zsh-autosuggestions-test | |
jobs: | |
# Load the ZSH_VERSIONS file as a JSON array to use as a matrix | |
# See https://stackoverflow.com/a/62953566/154703 | |
versions: | |
runs-on: ubuntu-22.04 | |
outputs: | |
versions: ${{ steps.set-versions.outputs.versions }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: set-versions | |
run: | | |
echo "versions=$( | |
grep "^[^#]" ZSH_VERSIONS \ | |
| sed -E 's/(^|$)/"/g' \ | |
| paste -sd ',' - \ | |
| sed -e 's/^/[/' -e 's/$/]/' | |
)" >> $GITHUB_OUTPUT | |
test: | |
needs: versions | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
version: ${{ fromJson(needs.versions.outputs.versions) }} | |
steps: | |
- run: echo ${{ matrix.version }} |