diff options
author | Bram <perl-rt@wizbit.be> | 2022-09-11 22:18:46 +0200 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-09-13 18:52:00 -0600 |
commit | 7f149ace48048515e5a070e2b2da2b22f5f3c4da (patch) | |
tree | f34892e7b430ed3529c4c63f17848214ed9f9460 /.github | |
parent | 36cbd62b85a5f50dee07893093ea0acfcf4ebccb (diff) | |
download | perl-7f149ace48048515e5a070e2b2da2b22f5f3c4da.tar.gz |
CI/cygwin: use `shell: sh`
Before it was using powershell (or cmd) to run a 'sh -c' command.
Change it to use `shell: sh` so it becomes a bit more readable.
For using `shell: sh` two problems had to be fixed:
- the GitHub runner creates a file with the 'run'-contents but it uses
a CRLF line ending which doesn't work with `sh`. The work-around for
that is to include `igncr` in SHELLOPTS (the 'igncr' option is
a cygwin patch to bash)
- SHELLOPTS contain 'errexit' which breaks ./Configure since it
stopped on the first non-zero exit status (which happened to be
a `grep`)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/testsuite.yml | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 1e9349d4b9..94bde99820 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -462,28 +462,51 @@ jobs: - name: Check out using Cygwin git, to ensure correct file permissions env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: cmd - run: | - path %GITHUB_WORKSPACE%\cygwin\bin;%GITHUB_WORKSPACE%\cygwin\usr\bin - sh -c "git config --global core.autocrlf false" - sh -c "mkdir -p ~; cd ~; git clone -qn \"https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY\" work ; cd work ; if [ \"$GITHUB_EVENT_NAME\" = pull_request ] ; then git fetch origin \"$GITHUB_REF\" && git checkout FETCH_HEAD ; else git checkout \"$GITHUB_SHA\" ; fi" + PATH: /usr/bin:/bin + SHELLOPTS: igncr + shell: sh + run: | + git config --global core.autocrlf false + mkdir -p ~ + cd ~ + git clone -qn "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" work + cd work + if [ "$GITHUB_EVENT_NAME" = pull_request ]; then + git fetch origin "$GITHUB_REF" && git checkout FETCH_HEAD + else + git checkout "$GITHUB_SHA" + fi - name: Configure - shell: cmd + shell: sh + env: + PATH: /usr/bin:/bin + SHELLOPTS: igncr run: | - path %GITHUB_WORKSPACE%\cygwin\bin;%GITHUB_WORKSPACE%\cygwin\usr\bin - sh -c "cd ~/work; ./Configure -des -Dusedevel -Doptimize=-g -DDEBUGGING" + cd ~/work + set +e + ./Configure -des -Dusedevel -Doptimize=-g -DDEBUGGING || exit 1 - name: Build - shell: cmd + shell: sh + env: + PATH: /usr/bin:/bin + SHELLOPTS: igncr run: | - path %GITHUB_WORKSPACE%\cygwin\bin;%GITHUB_WORKSPACE%\cygwin\usr\bin - sh -c "cd ~/work; make -j2 test_prep" + cd ~/work + make -j2 test_prep - name: Show Config - shell: cmd + shell: sh + env: + PATH: /usr/bin:/bin + SHELLOPTS: igncr run: | - path %GITHUB_WORKSPACE%\cygwin\bin;%GITHUB_WORKSPACE%\cygwin\usr\bin - sh -c "cd ~/work; ./perl -Ilib -V; ./perl -Ilib -e 'use Config; print Config::config_sh'" + cd ~/work + ./perl -Ilib -V + ./perl -Ilib -e 'use Config; print Config::config_sh' - name: Run Tests - shell: cmd + shell: sh + env: + PATH: /usr/bin:/bin + SHELLOPTS: igncr # Descend far enough down the cygwin yak warren, and one discovers that # hints/cygwin.sh sets ldlibpthname=PATH # Meaning that the Makefile variable LDLIBPTH is "PATH=..." @@ -496,8 +519,8 @@ jobs: # about 40 seconds, which is nearly 1% of the total wallclock time for # complete all CI runs. run: | - path %GITHUB_WORKSPACE%\cygwin\bin;%GITHUB_WORKSPACE%\cygwin\usr\bin - sh -c "cd ~/work; PATH=`pwd`:.:$PATH ./perl.exe t/TEST" + cd ~/work + PATH=`pwd`:.:$PATH ./perl.exe t/TEST # _ _ _ _ # _ __ ___ (_)_ __ (_) |_ ___ ___| |_ |