Skip to content

Commit

Permalink
Switch to GitHub Actions (#46)
Browse files Browse the repository at this point in the history
* Add github test action

* Remove .travis.yml

* Force interactive zsh on GH Actions

* Enable all previous versions of zsh

* Fix build for zsh 5.0.x

* test: Disable sigwinch test on zsh 5.0.2

* test: Decrease stress test flakyness

* Try to fix signals for zsh 5.0.2?

* Revert "Try to fix signals for zsh 5.0.2?"

* Ok, fine, bye bye 5.0.2
  • Loading branch information
mafredri committed Oct 24, 2020
1 parent 1e41772 commit 65c0885
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 66 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
zsh-version:
- "5.8"
- "5.7.1"
- "5.7"
- "5.6.2"
- "5.5.1"
- "5.4.2"
- "5.3.1"
- "5.3"
- "5.2"
- "5.1.1"
- "5.0.8"
# Can't make 5.0.2 work on GitHub Actions, missing signals.
# - "5.0.2"
runs-on: ${{matrix.os}}
steps:
- 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
cd "$GITHUB_WORKSPACE/zsh-build"
aclocal
autoconf
autoheader
./configure --prefix=/opt/zsh --without-tcsetpgrp
make
sudo make install.bin install.modules install.fns
- name: Checkout code
uses: actions/checkout@v2

- name: Run tests
timeout-minutes: 1
run: |
export PATH="/opt/zsh/bin:$PATH"
zsh --version
script -qec 'zsh -if ./test.zsh -v' /dev/null
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

8 changes: 6 additions & 2 deletions async_test.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test_async_process_results_stress() {
async_start_worker test
t_defer async_stop_worker test

integer iter=40 timeout=5
integer iter=20 timeout=5
for i in {1..$iter}; do
async_job test "print -n $i"
done
Expand Down Expand Up @@ -167,7 +167,7 @@ test_async_process_results_stress() {
[[ $want = $got ]] || t_error "want stdout: ${(Vq-)want}, got ${(Vq-)got}"

# Test with longer running commands (sleep, then print).
iter=40
iter=20
for i in {1..$iter}; do
async_job test "sleep 1 && print -n $i"
sleep 0.00001
Expand Down Expand Up @@ -312,6 +312,10 @@ test_async_worker_notify_sigwinch() {
local -a result
cb() { result=("$@") }

if ! is-at-least 5.0.3 && [[ -n $CI ]]; then
t_skip "Skip winch test on GitHub Actions for zsh 5.0.2: undefined signal: WINCH"
fi

ASYNC_USE_ZLE_HANDLER=0

async_start_worker test -n
Expand Down

0 comments on commit 65c0885

Please sign in to comment.