Skip to content

Commit

Permalink
Overengineer the installer
Browse files Browse the repository at this point in the history
  • Loading branch information
pschmitt committed Nov 15, 2021
1 parent 5440896 commit 3c3a223
Show file tree
Hide file tree
Showing 2 changed files with 392 additions and 118 deletions.
116 changes: 116 additions & 0 deletions .github/workflows/installer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: zinit installer
on: [push, workflow_dispatch]

jobs:
zinit-installer:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# TODO: macOS (jobs hang...)
# TODO: Windows...
# os: [ubuntu-latest, macos-11]
# os: [ubuntu-latest, macos-latest, windows-latest]
annexes: ["with-annexes", "without-annexes"]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Grab git slugs (short commit id, branch etc.)
uses: rlespinasse/github-slug-action@v3.x

- name: Install dependencies (ubuntu)
if: startsWith(matrix.os, 'ubuntu-latest')
run: |
sudo apt-get update
sudo apt-get install -y curl git zsh
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install curl git zsh
- name: Install zinit (with annexes)
if: matrix.annexes == 'with-annexes'
run: |
export ZINIT_COMMIT="$GITHUB_SHA"
export ZINIT_REPO="$GITHUB_REPOSITORY"
export ZINIT_BRANCH="$GITHUB_REF_SLUG"
export NO_INPUT=true
sh -x ./doc/install.sh
- name: Install zinit (w/o annexes)
if: matrix.annexes == 'without-annexes'
run: |
export ZINIT_COMMIT="$GITHUB_SHA"
export ZINIT_REPO="$GITHUB_REPOSITORY"
export ZINIT_BRANCH="$GITHUB_REF_SLUG"
export NO_INPUT=true
export NO_ANNEXES=true
sh -x ./doc/install.sh
- name: Upload zshrc and zinit files
uses: actions/upload-artifact@v2
with:
name: zinit-config-${{ matrix.os }}-${{ matrix.annexes }}
path: |
/home/runner/.zshrc
/home/runner/.local/share/zinit
- name: Test zinit install
run: |
export TERM=xterm
zsh -silc 'zinit --help; exit $?'
# TODO: DRY!
# Re-using steps in GH Actions is a pain though.
zinit-updater:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# TODO: macOS (jobs hang...)
# TODO: Windows...
# os: [ubuntu-latest, macos-11]
# os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Grab git slugs (short commit id, branch etc.)
uses: rlespinasse/github-slug-action@v3.x

- name: Install dependencies (ubuntu)
if: startsWith(matrix.os, 'ubuntu-latest')
run: |
sudo apt-get update
sudo apt-get install -y curl git zsh
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install curl git zsh
- name: Install previous zinit version (${{ github.event.before }})
env:
PREVIOUS_COMMIT: ${{ github.event.before }}
run: |
export ZINIT_COMMIT="$PREVIOUS_COMMIT"
export ZINIT_REPO="$GITHUB_REPOSITORY"
export ZINIT_BRANCH="$GITHUB_REF_SLUG"
export NO_INPUT=true
./doc/install.sh
- name: Update zinit from ${{ github.event.before }} to ${{ github.sha }}
run: |
export ZINIT_COMMIT="$GITHUB_SHA"
export ZINIT_REPO="$GITHUB_REPOSITORY"
export ZINIT_BRANCH="$GITHUB_REF_SLUG"
export NO_INPUT=true
./doc/install.sh
Loading

0 comments on commit 3c3a223

Please sign in to comment.