diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-29 12:34:26 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-29 12:34:26 -0600 |
| commit | a47d428362eb7d932f490190726a2a4811708ec8 (patch) | |
| tree | 7fcd25d34b04b92f1c005332407fa7629fea52eb | |
| parent | 99474ce7c2c94f0dde4b244b45b305ebc06b03b5 (diff) | |
| parent | 85f76423cda9977b42f3c098a23286c928861e4b (diff) | |
| download | zash-a47d428362eb7d932f490190726a2a4811708ec8.tar.gz | |
Merge pull request #50 from skurtz97/ci/packaging-and-github-actions
Add GitHub Actions Linux CI and fix zopen packaging checks
| -rw-r--r-- | .github/workflows/ci.yml | 54 | ||||
| -rw-r--r-- | buildenv | 7 | ||||
| -rw-r--r-- | src/jobs.c | 4 | ||||
| -rw-r--r-- | tests/linux/i-dscomplete.exp | 8 | ||||
| -rwxr-xr-x | tests/run.sh | 6 |
5 files changed, 71 insertions, 8 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a7c0b9e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + linux: + name: Linux build, z/OS lint, check, ASan + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Select Clang 19+ (C23 constexpr) + run: | + cc="" + for c in clang-21 clang-20 clang-19; do + if command -v "$c" >/dev/null 2>&1; then + cc="$c" + break + fi + done + if [ -z "$cc" ]; then + sudo apt-get update + sudo apt-get install -y --no-install-recommends clang-19 libclang-rt-19-dev + cc="clang-19" + fi + "$cc" --version + echo "CC=$cc" >> "$GITHUB_ENV" + + - name: Build (C23, warnings clean) + run: make CC="$CC" + + - name: Lint z/OS code paths and POSIX Makefile + run: make zos-lint CC="$CC" + + - name: Run functional and interactive test suite + env: + ZASH_TEST_SKIP: perf/startup + run: make check CC="$CC" + + - name: Run test suite under ASan + UBSan + LSan + run: make asan CC="$CC" + + - name: Verify staged install + run: | + make install DESTDIR="$RUNNER_TEMP/stage" PREFIX=/usr/local + "$RUNNER_TEMP/stage/usr/local/bin/zash" -c 'echo "install:$((16#FF))"' @@ -7,8 +7,11 @@ ZASH_VERSION="0.1.0" export ZOPEN_PROJECT_NAME="zash" export ZOPEN_BUILD_LINE="DEV" export ZOPEN_TYPE="LOCAL" -export ZOPEN_DEV_DEPS="make" -export ZOPEN_STABLE_DEPS="make" +# Build and test dependencies only (not runtime): tests/zos/tagging.sh uses +# gzip. Do not add coreutils here -- its altbin puts ASCII `cat` ahead of +# /bin/cat, which changes the EBCDIC external-writer test in zos/tagging. +export ZOPEN_DEV_DEPS="make gzip" +export ZOPEN_STABLE_DEPS="make gzip" export ZOPEN_CATEGORIES="shell" export ZOPEN_COMP="CLANG" # zash uses only POSIX/POSIX-adjacent libc calls; zoslib would add a runtime @@ -868,8 +868,10 @@ int builtin_wait(int argc, char **argv) { status = job_wait(j); if (job_get_state(j) == JOB_RUNNING) return status; /* interrupted by a trapped signal */ - if (job_get_state(j) == JOB_DONE) + if (job_get_state(j) == JOB_DONE) { + reaped_add(j->procs[j->nprocs - 1].pid, status); job_free(j); + } } return status; } diff --git a/tests/linux/i-dscomplete.exp b/tests/linux/i-dscomplete.exp index 999f2a9..762ae7f 100644 --- a/tests/linux/i-dscomplete.exp +++ b/tests/linux/i-dscomplete.exp @@ -22,14 +22,18 @@ $ echo "//'BIG.DATA.SET1 'BIG.DATA.SET1' 'BIG.DATA.SET10' 'BIG.DATA.SET100' 'BIG.DATA.SET101' 'BIG.DATA.SET102' 'BIG.DATA.SET103' 'BIG.DATA.SET104' 'BIG.DATA.SET105' 'BIG.DATA.SET106' 'BIG.DATA.SET107' 'BIG.DATA.SET108' 'BIG.DATA.SET109' -'BIG.DATA.SET11' 'BIG.DATA.SET110' 'BIG.DATA.SET111' 'BIG.DATA.SET12' +'BIG.DATA.SET11' 'BIG.DATA.SET110' 'BIG.DATA.SET111' 'BIG.DATA.SET112' +'BIG.DATA.SET113' 'BIG.DATA.SET114' 'BIG.DATA.SET115' 'BIG.DATA.SET116' +'BIG.DATA.SET117' 'BIG.DATA.SET118' 'BIG.DATA.SET119' 'BIG.DATA.SET12' 'BIG.DATA.SET13' 'BIG.DATA.SET14' 'BIG.DATA.SET15' 'BIG.DATA.SET16' ... and 3 more $ echo "//'BIG.DATA.SET1 'BIG.DATA.SET1' 'BIG.DATA.SET10' 'BIG.DATA.SET100' 'BIG.DATA.SET101' 'BIG.DATA.SET102' 'BIG.DATA.SET103' 'BIG.DATA.SET104' 'BIG.DATA.SET105' 'BIG.DATA.SET106' 'BIG.DATA.SET107' 'BIG.DATA.SET108' 'BIG.DATA.SET109' -'BIG.DATA.SET11' 'BIG.DATA.SET110' 'BIG.DATA.SET111' 'BIG.DATA.SET12' +'BIG.DATA.SET11' 'BIG.DATA.SET110' 'BIG.DATA.SET111' 'BIG.DATA.SET112' +'BIG.DATA.SET113' 'BIG.DATA.SET114' 'BIG.DATA.SET115' 'BIG.DATA.SET116' +'BIG.DATA.SET117' 'BIG.DATA.SET118' 'BIG.DATA.SET119' 'BIG.DATA.SET12' 'BIG.DATA.SET13' 'BIG.DATA.SET14' 'BIG.DATA.SET15' 'BIG.DATA.SET16' ... and 3 more $ echo "//'BIG.DATA.SET1 diff --git a/tests/run.sh b/tests/run.sh index 4df543f..ba51b18 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -62,9 +62,9 @@ esac # links, not shell scripts: a script found on PATH loses its stdin pipe # inside a z/OS spawn-script. if [ "$platform" = zos ]; then - # /etc/profile exports these for every login; the tests start from the - # state the manual describes, where only `set -o` puts them there. - unset _BPX_SHAREAS _BPX_SPAWN_SCRIPT + # /etc/profile and zopen export these; the tests start from the state + # the manual describes, where only `set -o` or the test sets them. + unset _BPX_SHAREAS _BPX_SPAWN_SCRIPT _TAG_REDIR_IN _TAG_REDIR_OUT _TAG_REDIR_ERR mkdir -p "$work/gnu" for t in sleep wc sort tr od; do g=$(command -v "g$t") && ln -s "$g" "$work/gnu/$t" |
