Skip to content

Commit

Permalink
ci: test different version of zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloxaf committed Feb 25, 2024
1 parent cdc34ee commit 9cad625
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 11 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/ci.yaml → .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: test on linux

on:
push:
Expand All @@ -10,29 +10,25 @@ on:

jobs:
test:
name: run test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: install zsh (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install zsh
- name: install zsh
run: sudo apt-get install -y zsh

- name: test completion (ubuntu)
if: matrix.os == 'ubuntu-latest'
- name: test completion
run: cd test && zsh -f runtests.zsh fzftab.ztst

- name: build binary module
run: zsh -fc 'source ./fzf-tab.zsh && build-fzf-tab-module'

- name: test binary module (ubuntu)
if: matrix.os == 'ubuntu-latest'
- name: test binary module
run: cd test && zsh -f runtests.zsh fzftab.ztst

28 changes: 28 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test on macOS

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

# FIXME: test on macOS
#- name: test completion
# run: cd test && zsh -f runtests.zsh fzftab.ztst

- name: build binary module
run: zsh -fc 'source ./fzf-tab.zsh && build-fzf-tab-module'

#- name: test binary module
# run: cd test && zsh -f runtests.zsh fzftab.ztst
45 changes: 45 additions & 0 deletions .github/workflows/zsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: test on different zsh versions

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# TODO: test fzf version?
zsh_version:
- 5.3.1
- 5.4.2
- 5.5.1
- 5.6.2
- 5.7.1
- 5.8
- 5.9
container:
image: zshusers/zsh:${{ matrix.zsh_version }}
steps:
- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: install dependencies
run: apt update && apt-get install -y git build-essential

- name: test completion
run: cd test && zsh -f runtests.zsh fzftab.ztst

- name: build binary module
run: zsh -fc 'source ./fzf-tab.zsh && build-fzf-tab-module'

- name: test binary module
run: cd test && zsh -f runtests.zsh fzftab.ztst

1 change: 1 addition & 0 deletions fzf-tab.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ build-fzf-tab-module() {
print -P "%F{green}%BThe module has been built successfully. Please restart zsh to apply it.%f%b"
else
print -P -u2 "%F{red}%BThe module building has failed. See the output above for details.%f%b"
return 1
fi
} always {
popd -q
Expand Down
2 changes: 1 addition & 1 deletion lib/-ftb-build-module
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/hint/zsh
emulate -LR zsh -o extended_glob -o err_exit
emulate -LR zsh -o extended_glob -o err_return

local zsh_version=${1:-${FZF_TAB_ZSH_SRC_VERSION:-$ZSH_VERSION}}

Expand Down
1 change: 1 addition & 0 deletions test/fzftab.ztst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
touch file1 &&
touch file2
touch dir1/file1
# TODO: remove git from tests
git init
}
else
Expand Down

0 comments on commit 9cad625

Please sign in to comment.