Skip to content

Commit

Permalink
Attempt to modernize github actions 🚦
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrieanKhisbe committed Jul 16, 2024
1 parent 6c0cdac commit 18a274f
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 18 deletions.
98 changes: 83 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,93 @@ name: Diractions CI
on: [push]

jobs:
tests:
name: Run tests
runs-on: ${{ matrix.os }}
macos:
name: macOS
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [macos-12, macos-11]
runs-on: ${{matrix.os}}
steps:
- name: Set up git repository
- name: Install deps
run: |
brew install tree antidote
- name: Checkout code
uses: actions/checkout@v2
- name: Install zsh & tree [linux]
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install zsh tree
- name: Install zsh & tree [mac]
if: runner.os != 'Linux'
run: brew install tree
- name: Install antigen
run: curl -L git.io/antigen > ~/antigen.zsh # install antigen

- name: Run tests
timeout-minutes: 1
run: |
zsh --version
script -q <<<'zsh -if ./test.zsh -v; exit $?'
ubuntu:
name: Ubuntu
strategy:
matrix:
os: [ubuntu-latest]
zsh-version:
- "5.9"
- "5.8.1"
- "5.8"
- "5.7.1"
- "5.7"
- "5.6.2"
- "5.5.1"
- "5.4.2"
# Too old to build/use on GitHub Actions (missing signals).
# - "5.3.1"
# - "5.3"
# - "5.2"
# - "5.1.1"
# - "5.0.8"
# - "5.0.2"

runs-on: ${{matrix.os}}
steps:
- name: Install deps
run: |
sudo apt-get install zsh
- name: Cache zsh
id: cache-zsh
uses: actions/cache@v2
with:
path: /opt/zsh
key: ${{runner.os}}-${{matrix.zsh-version}}

- name: Checkout zsh
if: steps.cache-zsh.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: zsh-users/zsh
ref: zsh-${{matrix.zsh-version}}
path: zsh-build

- name: Build zsh
if: steps.cache-zsh.outputs.cache-hit != 'true'
run: |
sudo apt-get install build-essential autoconf yodl libncurses-dev tree
cd "$GITHUB_WORKSPACE/zsh-build"
aclocal
autoconf
autoheader
script -qec './configure --prefix=/opt/zsh'
make
sudo make install.bin install.modules install.fns
- name: Install antidote
if: steps.cache-zsh.outputs.cache-hit != 'true'
run: |
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote
- name: Checkout code
uses: actions/checkout@v2

- name: Set up env
run: cat scripts/ci.zshrc > ~/.zshrc ; cat ~/.zshrc; echo "setopt sh_word_split" >> ~/.zshenv

- name: Tests
run: zsh scripts/ci-run.zsh
timeout-minutes: 2
run: |
export PATH="/opt/zsh/bin:$PATH"
zsh --version
zsh scripts/ci-run.zsh
12 changes: 9 additions & 3 deletions scripts/ci.zshrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
source ~/antigen.zsh

antigen bundle rylnd/shpec
antigen apply
if [ -f ~/.antidote/antidote.zsh ]; then
source ~/.antidote/antidote.zsh
fi
if [ -f /usr/local/opt/antidote/share/antidote/antidote.zsh ]; then
source /usr/local/opt/antidote/share/antidote/antidote.zsh
fi

antidote bundle rylnd/shpec
antidote apply

0 comments on commit 18a274f

Please sign in to comment.