From 14e0d2034af6c5a7f24e28c87ab43cac301a66c7 Mon Sep 17 00:00:00 2001 From: Mark Skilbeck Date: Sun, 4 Jul 2021 14:44:10 +0100 Subject: [PATCH 1/4] use github actions --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..6465d2cb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + test-magicl: + name: Test MAGICL + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run MAGICL tests + run: | + sudo make install-test-deps + make test + + From 845d388610a9919957647480818a1d00637f5117 Mon Sep 17 00:00:00 2001 From: Mark Skilbeck Date: Sun, 4 Jul 2021 16:01:11 +0100 Subject: [PATCH 2/4] Makefile: check for ID_LIKE in supported OS test --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index eaa425e4..a1261b95 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ install-test-deps: ifeq ($(UNAME_S),Linux) ifeq ($(shell sed -n "s/^ID=//p" /etc/os-release),debian) apt-get install -y libblas-dev libffi-dev liblapack-dev +else ifeq ($(shell sed -n "s/^ID_LIKE=//p" /etc/os-release),debian) + apt-get install -y libblas-dev libffi-dev liblapack-dev else ifneq (,$(wildcard /etc/redhat-release)) yum install -y blas-devel libffi-devel lapack-devel else From 27842bb626bab28919ad3204c26dc4338048766d Mon Sep 17 00:00:00 2001 From: Mark Skilbeck Date: Sun, 4 Jul 2021 16:24:01 +0100 Subject: [PATCH 3/4] Github: install sbcl --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6465d2cb..d7e86db3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,7 @@ jobs: - uses: actions/checkout@v2 - name: Run MAGICL tests run: | + sudo apt install sbcl sudo make install-test-deps make test From 23ecbf54eb312fdaa45d43c055a6ca629a145727 Mon Sep 17 00:00:00 2001 From: Mark Skilbeck Date: Sun, 4 Jul 2021 16:28:18 +0100 Subject: [PATCH 4/4] Makefile: quicklisp installation --- .github/workflows/test.yml | 1 + Makefile | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7e86db3..495f3997 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,7 @@ jobs: - name: Run MAGICL tests run: | sudo apt install sbcl + sudo make quicklisp sudo make install-test-deps make test diff --git a/Makefile b/Makefile index a1261b95..aaab88db 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,29 @@ QUICKLISP=$(SBCL) --load $(QUICKLISP_HOME)/setup.lisp \ UNAME_S=$(shell uname -s) +QUICKLISP_BOOTSTRAP_URL=https://beta.quicklisp.org/quicklisp.lisp + all: test +############################################################################### +# SETUP +############################################################################### + +$(QUICKLISP_SETUP): + mkdir -p $(QUICKLISP_HOME) + curl -o $(QUICKLISP_HOME)/quicklisp-bootstrap.lisp \ + $(QUICKLISP_BOOTSTRAP_URL) + $(SBCL) --load $(QUICKLISP_HOME)/quicklisp-bootstrap \ + --eval "(quicklisp-quickstart:install :path \"$(QUICKLISP_HOME)\")" + +system-index.txt: $(QUICKLISP_SETUP) + $(QUICKLISP) \ + $(FOREST_SDK_FEATURE) \ + --eval '(ql:quickload "cffi-grovel")' \ + --eval '(ql:quickload "qvm-app")' \ + --eval '(ql:quickload "qvm-app-ng")' \ + --eval '(ql:write-asdf-manifest-file "system-index.txt")' + install-test-deps: ifeq ($(UNAME_S),Linux) ifeq ($(shell sed -n "s/^ID=//p" /etc/os-release),debian) @@ -29,3 +50,24 @@ test: $(QUICKLISP) \ --eval "(ql:quickload :magicl-tests)" \ --eval '(asdf:test-system :magicl)' + +############################################################################### +# QUICKLISP UTILITES +############################################################################### + +# Download and install Quicklisp. +quicklisp: + curl -o /tmp/quicklisp.lisp "http://beta.quicklisp.org/quicklisp.lisp" + sbcl --noinform --non-interactive \ + --load /tmp/quicklisp.lisp \ + --eval '(quicklisp-quickstart:install)' + echo >> ~/.sbclrc + echo '#-quicklisp(let ((i(merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))(when(probe-file i)(load i)))' >> ~/.sbclrc + echo "#+quicklisp(push \"$(shell pwd | xargs dirname)/\" ql:*local-project-directories*)" >> ~/.sbclrc + rm -f /tmp/quicklisp.lisp + +# Update Quicklisp. +deps: $(QUICKLISP_SETUP) + rm -f system-index.txt + $(QUICKLISP) --eval '(ql:update-client :prompt nil)' + $(QUICKLISP) --eval '(ql:update-dist "quicklisp" :prompt nil)'