diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 76bec1f..276be53 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,10 +28,6 @@ jobs: lisp: sbcl-bin - os: ubuntu-latest lisp: ccl-bin - - # See issue: https://github.com/40ants/setup-lisp/issues/15 - # - os: ubuntu-latest - # lisp: clisp - os: ubuntu-latest lisp: clisp-head - os: ubuntu-latest @@ -40,13 +36,17 @@ jobs: lisp: allegro - os: ubuntu-latest lisp: abcl-bin - # See issue: https://github.com/40ants/setup-lisp/issues/16 - # - os: ubuntu-latest - # lisp: clasp - os: ubuntu-latest lisp: clasp-bin - os: ubuntu-latest 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 # - os: ubuntu-latest # lisp: mkcl @@ -55,20 +55,20 @@ jobs: # lisp: npt defaults: run: - shell: lispsh {0} + shell: lispsh -eo pipefail {0} env: LISP: ${{ matrix.lisp }} name: test with ${{ matrix.lisp }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} timeout-minutes: 10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: # 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 # clone the repository somewhere else (i.e. something different from # the default './') - path: setup-lisp/ + path: setup-lisp - name: Call setup-lisp with default arguments if: github.event_name != 'schedule' uses: ./setup-lisp/ @@ -82,6 +82,7 @@ jobs: # https://github.com/roswell/roswell/issues/497 asdf-version: 3.3.5.3 qlot-version: latest + - run: which ros - run: ros config - run: qlot exec ros install 40ants/cl-info - run: qlot exec cl-info diff --git a/action.yml b/action.yml index 3b58843..4bc8bbe 100644 --- a/action.yml +++ b/action.yml @@ -42,6 +42,7 @@ runs: - name: Create lispsh shell: bash run: | + echo ::group::Set up link to lispsh # All the steps below, should work without problems on Linux, Mac OS, # and Windows, provided that they are run with the "right" shell # parameter, i.e. bash for Linux and Mac OS, and msys2 for Windows. @@ -68,42 +69,13 @@ runs: else sudo ln -sf $(which bash) /usr/local/bin/lispsh fi + echo ::endgroup:: - name: Set up Environment shell: bash run: | echo ::group::Set up Environment 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 #: - # Subprocess # - # with command "C:\\Program Files\\Git\\usr\\local\\bin\\ros.exe config set setup.time 3843610170" - # exited with error code 1 - # - # Backtrace for: # - # - # 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 # defined, and when not there, it would go and install msys2 (i.e. # `ros install msys2+`) and rely on the `bash` bonary that comes @@ -164,8 +136,6 @@ runs: run: | echo ::group::Installing Roswell dependencies - - if [[ "$RUNNER_OS" == "Linux" ]]; then sudo apt-get update sudo apt-get -y install git build-essential automake libcurl4-openssl-dev @@ -182,10 +152,10 @@ runs: if [[ "${{ inputs.roswell-version }}" != "latest" ]]; then 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 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 echo ::endgroup:: @@ -290,5 +260,25 @@ runs: - name: Check it is possible to run desired lisp implementation 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:: diff --git a/changelog.lisp b/changelog.lisp index dd641ef..ebe40a7 100644 --- a/changelog.lisp +++ b/changelog.lisp @@ -6,7 +6,21 @@ (defchangelog (:ignore-words ("ASDF" + "PATH" "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 " # Changed diff --git a/docs.lisp b/docs.lisp index 1301d6d..3af818d 100644 --- a/docs.lisp +++ b/docs.lisp @@ -76,7 +76,16 @@ and [Qlot](https://github.com/fukamachi/qlot) inside the Github CI. (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** | diff --git a/test.ros b/test.ros index 8c1abfb..9700ada 100755 --- a/test.ros +++ b/test.ros @@ -60,5 +60,9 @@ exec ros -Q -- $0 "$@" (error "Real implementation is \"~A\", but \"~A\" was expected when LISP=~A." real-implementation 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: