Merge pull request #19 from 40ants/fix-test-ros

Fix test ros
This commit is contained in:
Alexander Artemenko 2024-01-30 19:30:22 +03:00 committed by GitHub
commit 24ec3e22bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 66 additions and 48 deletions

View file

@ -28,10 +28,6 @@ jobs:
lisp: sbcl-bin lisp: sbcl-bin
- os: ubuntu-latest - os: ubuntu-latest
lisp: ccl-bin lisp: ccl-bin
# See issue: https://github.com/40ants/setup-lisp/issues/15
# - os: ubuntu-latest
# lisp: clisp
- os: ubuntu-latest - os: ubuntu-latest
lisp: clisp-head lisp: clisp-head
- os: ubuntu-latest - os: ubuntu-latest
@ -40,13 +36,17 @@ jobs:
lisp: allegro lisp: allegro
- os: ubuntu-latest - os: ubuntu-latest
lisp: abcl-bin lisp: abcl-bin
# See issue: https://github.com/40ants/setup-lisp/issues/16
# - os: ubuntu-latest
# lisp: clasp
- os: ubuntu-latest - os: ubuntu-latest
lisp: clasp-bin lisp: clasp-bin
- os: ubuntu-latest - os: ubuntu-latest
lisp: cmu-bin lisp: cmu-bin
# See issue: https://github.com/40ants/setup-lisp/issues/15
# - os: ubuntu-latest
# lisp: clisp
# See issue: https://github.com/40ants/setup-lisp/issues/16
# - os: ubuntu-latest
# lisp: clasp
# See issue: https://github.com/40ants/setup-lisp/issues/17 # See issue: https://github.com/40ants/setup-lisp/issues/17
# - os: ubuntu-latest # - os: ubuntu-latest
# lisp: mkcl # lisp: mkcl
@ -55,20 +55,20 @@ jobs:
# lisp: npt # lisp: npt
defaults: defaults:
run: run:
shell: lispsh {0} shell: lispsh -eo pipefail {0}
env: env:
LISP: ${{ matrix.lisp }} LISP: ${{ matrix.lisp }}
name: test with ${{ matrix.lisp }} on ${{ matrix.os }} name: test with ${{ matrix.lisp }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
# The repo already contains the qlot and qlot.lock files, and since # The repo already contains the qlot and qlot.lock files, and since
# we don't want those to interfere with the current test run, we # we don't want those to interfere with the current test run, we
# clone the repository somewhere else (i.e. something different from # clone the repository somewhere else (i.e. something different from
# the default './') # the default './')
path: setup-lisp/ path: setup-lisp
- name: Call setup-lisp with default arguments - name: Call setup-lisp with default arguments
if: github.event_name != 'schedule' if: github.event_name != 'schedule'
uses: ./setup-lisp/ uses: ./setup-lisp/
@ -82,6 +82,7 @@ jobs:
# https://github.com/roswell/roswell/issues/497 # https://github.com/roswell/roswell/issues/497
asdf-version: 3.3.5.3 asdf-version: 3.3.5.3
qlot-version: latest qlot-version: latest
- run: which ros
- run: ros config - run: ros config
- run: qlot exec ros install 40ants/cl-info - run: qlot exec ros install 40ants/cl-info
- run: qlot exec cl-info - run: qlot exec cl-info

View file

@ -42,6 +42,7 @@ runs:
- name: Create lispsh - name: Create lispsh
shell: bash shell: bash
run: | run: |
echo ::group::Set up link to lispsh
# All the steps below, should work without problems on Linux, Mac OS, # All the steps below, should work without problems on Linux, Mac OS,
# and Windows, provided that they are run with the "right" shell # and Windows, provided that they are run with the "right" shell
# parameter, i.e. bash for Linux and Mac OS, and msys2 for Windows. # parameter, i.e. bash for Linux and Mac OS, and msys2 for Windows.
@ -68,42 +69,13 @@ runs:
else else
sudo ln -sf $(which bash) /usr/local/bin/lispsh sudo ln -sf $(which bash) /usr/local/bin/lispsh
fi fi
echo ::endgroup::
- name: Set up Environment - name: Set up Environment
shell: bash shell: bash
run: | run: |
echo ::group::Set up Environment echo ::group::Set up Environment
if [[ "$RUNNER_OS" == "Windows" ]]; then if [[ "$RUNNER_OS" == "Windows" ]]; then
# ROSWELL_INSTALL_DIR defaults to /usr/local/bin which
# unfortunately is not part of PATH on Windows; one could be
# tempted to patch things up like this:
#
# echo /usr/local/bin >> $GITHUB_PATH
#
# However, if the absolute Windows path that /usr/local/bin
# actually refers to, contains any white space in it, you will
# inevitably bump into the following error:
#
# 'C:\Program' is not recognized as an internal or external command,
# operable program or batch file.
# Install Script for sbcl-bin...
# 'C:\Program' is not recognized as an internal or external command,
# operable program or batch file.
# Unhandled UIOP/RUN-PROGRAM:SUBPROCESS-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
# {10057000A3}>:
# Subprocess #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {100506B0E3}>
# with command "C:\\Program Files\\Git\\usr\\local\\bin\\ros.exe config set setup.time 3843610170"
# exited with error code 1
#
# Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10057000A3}>
#
# The work-around? Install Roswell in a different location, whose
# absolute path we are 100% positive won't contain any white
# spaces!
mkdir -p /d/a/_temp/roswell
echo ROSWELL_INSTALL_DIR=/d/a/_temp/roswell >> $GITHUB_ENV
echo /d/a/_temp/roswell >> $GITHUB_PATH
# Roswell internally checks for the MSYSCON env varible to be # Roswell internally checks for the MSYSCON env varible to be
# defined, and when not there, it would go and install msys2 (i.e. # defined, and when not there, it would go and install msys2 (i.e.
# `ros install msys2+`) and rely on the `bash` bonary that comes # `ros install msys2+`) and rely on the `bash` bonary that comes
@ -164,8 +136,6 @@ runs:
run: | run: |
echo ::group::Installing Roswell dependencies echo ::group::Installing Roswell dependencies
if [[ "$RUNNER_OS" == "Linux" ]]; then if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update sudo apt-get update
sudo apt-get -y install git build-essential automake libcurl4-openssl-dev sudo apt-get -y install git build-essential automake libcurl4-openssl-dev
@ -182,10 +152,10 @@ runs:
if [[ "${{ inputs.roswell-version }}" != "latest" ]]; then if [[ "${{ inputs.roswell-version }}" != "latest" ]]; then
echo ::group::Installing Roswell ${{ inputs.roswell-version }} echo ::group::Installing Roswell ${{ inputs.roswell-version }}
curl -L https://raw.githubusercontent.com/roswell/roswell/${{ inputs.roswell-version }}/scripts/install-for-ci.sh | sh -x curl -L https://raw.githubusercontent.com/roswell/roswell/${{ inputs.roswell-version }}/scripts/install-for-ci.sh | bash -xeo pipefail
else else
echo ::group::Installing latest Roswell echo ::group::Installing latest Roswell
curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh -x curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | bash -xeo pipefail
fi fi
echo ::endgroup:: echo ::endgroup::
@ -290,5 +260,25 @@ runs:
- name: Check it is possible to run desired lisp implementation - name: Check it is possible to run desired lisp implementation
shell: lispsh -eo pipefail {0} shell: lispsh -eo pipefail {0}
run: setup-lisp/test.ros # Call ${{ github.action_path }}test.ros does not work on windows
# because of backslashes.
#
# Here we are using sed to transform slashes in the path.
# Without this trick it is impossible to run test.ros on Windows.
#
# The other way to do the trick is to change write path to GITHUB_PATH.
# In this case, GitHub itself will convert backslashes. Hovewer, this
# way the path will be added to the PATH variable of the workflow
# which used setup-lisp and I consider this is not desired behaviour.
run: |
echo ::group::Checking if we installed correct Lisp implementation
if [[ "$RUNNER_OS" == "Windows" ]]; then
ACTION_PATH="$(echo '${{ github.action_path }}' | sed -e 's|/|\\|')\\"
else
ACTION_PATH='${{ github.action_path }}/'
fi
${ACTION_PATH}test.ros
echo ::endgroup::

View file

@ -6,7 +6,21 @@
(defchangelog (:ignore-words ("ASDF" (defchangelog (:ignore-words ("ASDF"
"PATH"
"HOME")) "HOME"))
(3.2.0 2023-01-30
"
# Changed
* Now action uses `bash -xeo pipefail` for running Roswell install script. This way, in case of some errors inside the script, it will be interrupted immediately.
* Also, we don't attempt to set `ROSWELL_INSTALL_DIR` env variable anymore, because despite it's presence, Roswell was installed into `/mingw64/bin/` instead under Windows and it works well (at least for me).
* Now we don't add action's directory to the `PATH` using modification of `GITHUB_PATH` variable. This prevents modification of the `PATH` of a workflow called the action.
# Fixed
* Fixed running of test.ros script under Windows.
")
(3.1.0 2023-01-27 (3.1.0 2023-01-27
" "
# Changed # Changed

View file

@ -76,7 +76,16 @@ and [Qlot](https://github.com/fukamachi/qlot) inside the Github CI.
(defsection @implementation-support (:title "Implementation support") (defsection @implementation-support (:title "Implementation support")
" "
Most implementations are tested on Linux, but for some of them Windows and OSX are also should work: Most implementations are tested on Linux, but for some of them Windows and OSX are also should work.
Note, that for correct execution, your workflow should use `lispsh -eo pipefail` instead of default `bash`.
This way a workflow will work Linux, OSX and Windows. You you will ignore this advice, you'll see such error
when trying to call `ros` or `qlot` scripts:
```
/c/Users/runneradmin/.roswell/lisp/quicklisp/bin/qlot: line 4: exec: ros: not found
Error: Process completed with exit code 127.
```
| **Implementation** | **Supported** | | **Implementation** | **Supported** |

View file

@ -60,5 +60,9 @@ exec ros -Q -- $0 "$@"
(error "Real implementation is \"~A\", but \"~A\" was expected when LISP=~A." (error "Real implementation is \"~A\", but \"~A\" was expected when LISP=~A."
real-implementation real-implementation
expected expected
needed-lisp)))))) needed-lisp))
(format t "Everything ok, we are running on \"~A\" as expected for LISP=~A."
real-implementation
needed-lisp)))))
;;; vim: set ft=lisp lisp: ;;; vim: set ft=lisp lisp: