Added a test to check if need lisp really was installed and activated.
This commit is contained in:
parent
3bf08fa821
commit
b7a3e0ed16
6 changed files with 183 additions and 26 deletions
45
.github/workflows/tests.yml
vendored
45
.github/workflows/tests.yml
vendored
|
@ -2,25 +2,57 @@ name: tests
|
|||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "0 0 * * SUN"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
# We want to run on external PRs, but not on our own internal PRs as
|
||||
# they'll be run by the push to the branch.
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
strategy:
|
||||
fail-fast: false # Let the workflow continue as much as possible
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
lisp: sbcl-bin
|
||||
lisp: sbcl
|
||||
# Just to ensure test.ros will not fail when version
|
||||
# is specified explicitly
|
||||
- os: ubuntu-latest
|
||||
lisp: sbcl/2.3.1
|
||||
- os: macos-latest
|
||||
lisp: sbcl-bin
|
||||
- os: windows-latest
|
||||
lisp: sbcl-bin
|
||||
- os: ubuntu-latest
|
||||
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
|
||||
lisp: ecl
|
||||
- os: ubuntu-latest
|
||||
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/17
|
||||
# - os: ubuntu-latest
|
||||
# lisp: mkcl
|
||||
# See issue: https://github.com/40ants/setup-lisp/issues/18
|
||||
# - os: ubuntu-latest
|
||||
# lisp: npt
|
||||
defaults:
|
||||
run:
|
||||
shell: lispsh {0}
|
||||
|
@ -28,6 +60,7 @@ jobs:
|
|||
LISP: ${{ matrix.lisp }}
|
||||
name: test with ${{ matrix.lisp }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
|
@ -50,4 +83,6 @@ jobs:
|
|||
asdf-version: 3.3.5.3
|
||||
qlot-version: latest
|
||||
- run: ros config
|
||||
- run: qlot exec ros install 40ants/gh-pages
|
||||
- run: qlot exec ros install 40ants/cl-info
|
||||
- run: qlot exec cl-info
|
||||
|
||||
|
|
55
action.yml
55
action.yml
|
@ -4,7 +4,7 @@ inputs:
|
|||
roswell-version:
|
||||
description: 'Roswell version to install. If not specified, the latest working version will be used; if "latest", the latest version is used'
|
||||
required: false
|
||||
default: v21.10.14.111
|
||||
default: v23.10.14.114
|
||||
asdf-system:
|
||||
description: 'ASDF system to install'
|
||||
required: false
|
||||
|
@ -52,7 +52,11 @@ runs:
|
|||
# workaround I came up with is:
|
||||
#
|
||||
# 1. Symlink bash/msys2 to a known location, i.e. lispsh
|
||||
# 2. Use lispsh as shell parameter
|
||||
# 2. Use lispsh -eo pipefail {0} as shell parameter
|
||||
#
|
||||
# Pay attention to -eo pipefail options. We need them to exit on the
|
||||
# first error. Without this option, Roswell might fail to install the
|
||||
# implementation and continue to execute everything with default SBCL.
|
||||
#
|
||||
# It's not ideal, but the alternative is to duplicate most of the steps
|
||||
# below, and have some of them with `shell: bash`, and others with
|
||||
|
@ -68,6 +72,7 @@ runs:
|
|||
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
|
||||
|
@ -155,9 +160,12 @@ runs:
|
|||
env | sort -u
|
||||
echo ::endgroup::
|
||||
- name: Install Roswell
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
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,14 +190,14 @@ runs:
|
|||
|
||||
echo ::endgroup::
|
||||
- name: Upgrade Quicklisp dists
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: |
|
||||
# The parent workflow might have caching enabled for Roswell and all
|
||||
# the other Lisp files in general, so it's better to tell Quicklisp
|
||||
# to update all its dists.
|
||||
ros -e "(ql:update-all-dists :prompt nil)"
|
||||
- name: Install Quicklisp patch for package-inferred systems
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: |
|
||||
git clone \
|
||||
--no-tags \
|
||||
|
@ -201,18 +209,23 @@ runs:
|
|||
mkdir -p ~/.roswell
|
||||
|
||||
cat >> ~/.roswell/init.lisp <<EOF
|
||||
(let ((fix-filename (make-pathname :directory '(:absolute :home ".quicklisp-client-fix")
|
||||
:name "quicklisp-fix"
|
||||
:type "lisp")))
|
||||
(cond
|
||||
((probe-file fix-filename)
|
||||
(format t "Loading quicklisp fix.~%")
|
||||
(load fix-filename))
|
||||
(t
|
||||
(format t "Quicklisp fix was not found at ~S.~%" fix-filename))))
|
||||
(handler-bind ((error #'(lambda (c)
|
||||
(uiop:print-condition-backtrace c)
|
||||
(uiop:quit 1))))
|
||||
(let ((fix-filename (merge-pathnames
|
||||
(make-pathname :directory '(:relative ".quicklisp-client-fix")
|
||||
:name "quicklisp-fix"
|
||||
:type "lisp")
|
||||
(user-homedir-pathname))))
|
||||
(cond
|
||||
((probe-file fix-filename)
|
||||
(format t "Loading quicklisp fix.~%")
|
||||
(load fix-filename))
|
||||
(t
|
||||
(format t "Quicklisp fix was not found at ~S.~%" fix-filename)))))
|
||||
EOF
|
||||
- name: Upgrade ASDF to the Latest Version
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: |
|
||||
if [[ "${{ inputs.asdf-version }}" != "latest" ]]; then
|
||||
echo ::group::Installing ASDF ${{ inputs.asdf-version }}
|
||||
|
@ -223,7 +236,7 @@ runs:
|
|||
fi
|
||||
echo ::endgroup::
|
||||
- name: Install Qlot
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: |
|
||||
if [[ "${{ inputs.qlot-version }}" != "latest" ]]; then
|
||||
echo ::group::Installing Qlot ${{ inputs.qlot-version }}
|
||||
|
@ -235,7 +248,7 @@ runs:
|
|||
echo .qlot/bin >> $GITHUB_PATH
|
||||
echo ::endgroup::
|
||||
- name: Create Qlot Environment
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: |
|
||||
echo ::group::Create Qlot Environment
|
||||
|
||||
|
@ -264,12 +277,18 @@ runs:
|
|||
# all possible roswell scripts, if the system
|
||||
# has them in the roswell/ subdirectory:
|
||||
- name: Install ASDF System
|
||||
shell: lispsh {0}
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: |
|
||||
echo ::group::Install ASDF System
|
||||
|
||||
if [[ -n "${{ inputs.asdf-system }}" ]]; then
|
||||
qlot exec ros install ${{ inputs.asdf-system }}
|
||||
else
|
||||
echo "ASDF system wasn't provided."
|
||||
fi
|
||||
echo ::endgroup::
|
||||
|
||||
- name: Check it is possible to run desired lisp implementation
|
||||
shell: lispsh -eo pipefail {0}
|
||||
run: setup-lisp/test.ros
|
||||
|
||||
|
|
|
@ -5,7 +5,22 @@
|
|||
(in-package project-docs/changelog)
|
||||
|
||||
|
||||
(defchangelog (:ignore-words ("ASDF"))
|
||||
(defchangelog (:ignore-words ("ASDF"
|
||||
"HOME"))
|
||||
(3.1.0 2023-01-27
|
||||
"
|
||||
# Changed
|
||||
|
||||
* Switched from Roswell v21.10.14.111 to v23.10.14.114.
|
||||
* Now action checks if it is really installed requested Lisp implementation.
|
||||
* A list of supported implementation was added to the documentation.
|
||||
* Some implementation supported by Roswell, have problems. If you need them, please, contribute the fix either to this action or to the Roswell itself.
|
||||
|
||||
# Fixed
|
||||
|
||||
* Now all steps fail-fast on the first encountered error. Previously some step might be failed, but action's execution was considered success.
|
||||
* Fixed Quicklisp fix activation for lisp implementations which are not support :HOME as part of the pathname.
|
||||
")
|
||||
(3.0.0 2023-12-14
|
||||
"Now action uses a fix for Quicklisp client which makes it possible to load package inferred ASDF systems by name of the subsystem.")
|
||||
(2.1.0 2022-11-10
|
||||
|
|
24
docs.lisp
24
docs.lisp
|
@ -46,6 +46,7 @@ necessary to make available [Roswell](https://github.com/roswell/roswell)
|
|||
and [Qlot](https://github.com/fukamachi/qlot) inside the Github CI.
|
||||
"
|
||||
(@features section)
|
||||
(@implementation-support section)
|
||||
(@typical-usage section)
|
||||
(@roswell-version section)
|
||||
(@asdf-version section)
|
||||
|
@ -73,6 +74,29 @@ 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:
|
||||
|
||||
|
||||
| **Implementation** | **Supported** |
|
||||
|--------------------|------------------------------------------------------|
|
||||
| abcl-bin | ✅ |
|
||||
| allegro | ✅ |
|
||||
| ccl-bin | ✅ |
|
||||
| clasp | [❌](https://github.com/40ants/setup-lisp/issues/16) |
|
||||
| clasp-bin | ✅ |
|
||||
| clisp | [❌](https://github.com/40ants/setup-lisp/issues/15) |
|
||||
| clisp-head | ✅ |
|
||||
| cmu-bin | ✅ |
|
||||
| ecl | ✅ |
|
||||
| mkcl | [❌](https://github.com/40ants/setup-lisp/issues/17) |
|
||||
| npt | [❌](https://github.com/40ants/setup-lisp/issues/18) |
|
||||
| sbcl | ✅ |
|
||||
| sbcl-bin | ✅ |
|
||||
|
||||
")
|
||||
|
||||
(defsection @typical-usage (:title "A typical usage")
|
||||
"
|
||||
Here is how a minimal GitHub Workflow might look like:
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
("quicklisp" .
|
||||
(:class qlot/source/dist:source-dist
|
||||
:initargs (:distribution "http://beta.quicklisp.org/dist/quicklisp.txt" :%version :latest)
|
||||
:version "2022-11-07"))
|
||||
:version "2023-10-21"))
|
||||
("ultralisp" .
|
||||
(:class qlot/source/dist:source-dist
|
||||
:initargs (:distribution "http://dist.ultralisp.org" :%version :latest)
|
||||
:version "20221109175500"))
|
||||
:version "20240127152000"))
|
||||
("sly" .
|
||||
(:class qlot/source/github:source-github
|
||||
:initargs (:repos "svetlyak40wt/sly" :ref nil :branch "patches" :tag nil)
|
||||
|
|
64
test.ros
Executable file
64
test.ros
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/sh
|
||||
#|-*- mode:lisp -*-|#
|
||||
#|
|
||||
exec ros -Q -- $0 "$@"
|
||||
|#
|
||||
(progn ;;init forms
|
||||
(ros:ensure-asdf)
|
||||
#+quicklisp(ql:quickload '() :silent t)
|
||||
)
|
||||
|
||||
(defpackage :ros.script.test
|
||||
(:use :cl))
|
||||
(in-package :ros.script.test)
|
||||
|
||||
|
||||
(defparameter *lisps*
|
||||
'(("sbcl-bin" . "SBCL")
|
||||
("sbcl" . "SBCL")
|
||||
("clisp" . "CLISP")
|
||||
("clisp-head" . "CLISP")
|
||||
("ccl-bin" . "Clozure Common Lisp")
|
||||
("clasp" . "clasp")
|
||||
("clasp-bin" . "clasp")
|
||||
("cmu-bin" . "CMU Common Lisp")
|
||||
("allegro" . "International Allegro CL Free Express Edition")
|
||||
("abcl-bin" . "Armed Bear Common Lisp")
|
||||
("npt" . "NPT")
|
||||
("ecl" . "ECL")))
|
||||
|
||||
|
||||
(defun cut-before (char text)
|
||||
(let ((pos (position char text)))
|
||||
(if pos
|
||||
(subseq text 0 pos)
|
||||
text)))
|
||||
|
||||
|
||||
(defun main (&rest argv)
|
||||
(declare (ignorable argv))
|
||||
(handler-bind ((error (lambda (c)
|
||||
(uiop:print-condition-backtrace c)
|
||||
;; Not all implementation do quit with correct status code
|
||||
;; in case if we just signal and error :(
|
||||
;; Example of such implementations: CCL-BIN
|
||||
(uiop:quit 1))))
|
||||
(let ((needed-lisp (uiop:getenv "LISP")))
|
||||
(unless needed-lisp
|
||||
(error "Env variable LISP was not set."))
|
||||
|
||||
(let ((expected (or (cdr (assoc needed-lisp *lisps* :test #'string-equal))
|
||||
(cdr (assoc (cut-before #\/ needed-lisp) *lisps* :test #'string-equal))))
|
||||
(real-implementation (lisp-implementation-type)))
|
||||
(unless expected
|
||||
(error "This test does not support LISP=~A. The real-implementation=~A."
|
||||
needed-lisp
|
||||
real-implementation))
|
||||
|
||||
(unless (string-equal real-implementation
|
||||
expected)
|
||||
(error "Real implementation is \"~A\", but \"~A\" was expected when LISP=~A."
|
||||
real-implementation
|
||||
expected
|
||||
needed-lisp))))))
|
||||
;;; vim: set ft=lisp lisp:
|
Loading…
Reference in a new issue