diff --git a/.github/workflows/github-workflow-tests.lisp b/.github/workflows/github-workflow-tests.lisp new file mode 100644 index 0000000..375746f --- /dev/null +++ b/.github/workflows/github-workflow-tests.lisp @@ -0,0 +1,23 @@ +(in-package :cl-user) + +#+sbcl +(require :asdf) + +(load "/tmp/ql-dir/quicklisp.lisp") +(quicklisp-quickstart:install) + +(ql:quickload :closer-mop) +(ql:quickload :yacc) +(ql:quickload :cl-custom-hash-table) + +#+(or abcl clisp ecl) +(ql:quickload :cl-fad) + +#-allegro +(ql:quickload :ptester) + +(load "/home/runner/work/cl-python/cl-python/clpython.asd") + +(ql:quickload :clpython) + +(asdf:test-system :clpython) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 0000000..5b316d2 --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,43 @@ +name: build & test +on: + push: + branches: + - master + - dev +jobs: + + install_quicklisp: + name: Install QuickLisp + runs-on: ubuntu-latest + steps: + - run: | + cd /tmp + mkdir ql-dir + cd ql-dir + wget -q https://beta.quicklisp.org/quicklisp.lisp + chmod -R a+rwx /tmp/ql-dir + - name: Upload Quicklisp artifact + uses: actions/upload-artifact@v4 + with: + name: ql-artifact + path: /tmp/ql-dir + + run_test_suites: + name: Test on ${{ matrix.scenario }} + runs-on: ubuntu-latest + strategy: + matrix: + scenario: [sbcl] + needs: [install_quicklisp] + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: ql-artifact + path: /tmp/ql-dir + + - if: matrix.scenario == 'sbcl' + run: | + sudo apt-get install sbcl + sbcl --script /home/runner/work/cl-python/cl-python/.github/workflows/github-workflow-tests.lisp diff --git a/clpython.asd b/clpython.asd index d0aa9e0..b58f8c7 100644 --- a/clpython.asd +++ b/clpython.asd @@ -12,6 +12,8 @@ (eval-when (:compile-toplevel) (error "This ASDF file should be run interpreted.")) +(eval-when (compile load eval) + (import '(asdf:defsystem asdf:load-op asdf:test-op))) ;;; CL-Python is split into several ASDF systems, to make it possible to load ;;; specific components -- in particular, to load the compiler or parser without @@ -31,7 +33,7 @@ (muffle-warning c)))))) (funcall thunk))) -(defsystem "clpython/basic" +(asdf:defsystem "clpython/basic" :description "CLPython package and utils" :depends-on ("closer-mop") :serial t @@ -53,7 +55,7 @@ (when (asdf:find-system "yacc" nil) (pushnew :have-cl-yacc *features*)) -(defsystem "clpython/parser" +(asdf:defsystem "clpython/parser" :description "Python parser, code walker, and pretty printer" :depends-on ("clpython/basic" "closer-mop" @@ -68,7 +70,7 @@ (:file "walk" ) (:file "pprint" ))))) -(defsystem "clpython/compiler" +(asdf:defsystem "clpython/compiler" :description "Python compiler" :depends-on ("clpython/basic" "clpython/parser" "clpython/runtime" "closer-mop") :serial t @@ -81,7 +83,7 @@ (:file "generator" ) (:file "optimize" ))))) -(defsystem "clpython/runtime" +(asdf:defsystem "clpython/runtime" :description "Python runtime environment" :depends-on ("clpython/basic" "closer-mop" #+(or abcl clisp ecl) "cl-custom-hash-table" "cl-fad") :components ((:module "runtime" @@ -96,7 +98,7 @@ (:file "run" ) (:file "import" ))))) -(defsystem "clpython/lib" +(asdf:defsystem "clpython/lib" :description "Python module library" :depends-on ("clpython/basic" "clpython/runtime" "clpython/compiler" #| TODO: remove compiler dep |#) :components ((:module "lib" @@ -141,7 +143,7 @@ (:file "time" :depends-on ("lsetup")) (:file "_weakref" :depends-on ("lsetup")))))) -(defsystem "clpython/contrib" +(asdf:defsystem "clpython/contrib" :description "CLPython contributions and experiments" :depends-on ("clpython/basic" "clpython/runtime" "clpython/compiler") :components ((:module "contrib"