Skip to content

Commit

Permalink
Run Python example in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Jun 24, 2024
1 parent 1b400b5 commit 9cd4c23
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ jobs:
working-directory: examples/libcalc
env:
SBCL_SRC: ${{ github.workspace }}/../sbcl
LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:.
LD_LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:.
LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:${{ github.workspace }}/examples/libcalc
LD_LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:/usr/local/lib
CL_SOURCE_REGISTRY: "${{ github.workspace }}//"
run: |
$SBCL_SRC/run-sbcl.sh --script script.lisp
gcc -Wall -fPIC -shared -o libcalc.so libcalc.c -lsbcl
gcc -Wall -o example example.c -lcalc -lsbcl
sudo mv libcalc.so /usr/local/lib
sudo cp libcalc.core /usr/local/lib
echo "(+ 1 2)" | ./example
echo "(+ 1 2)" | python ./example.py
1 change: 1 addition & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ jobs:
gcc -Wall -fPIC -shared -o libcalc.dylib libcalc.c -lsbcl
gcc -Wall -o example example.c -lcalc -lsbcl
echo "(+ 1 2)" | ./example
echo "(+ 1 2)" | python3 ./example.py
11 changes: 7 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ jobs:
working-directory: examples/libcalc
env:
SBCL_SRC: ${{ github.workspace }}/../sbcl
LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime;.
CL_SOURCE_REGISTRY: "${{ github.workspace }}//"
MSYS2_PATH_TYPE: inherit
run: |
$SBCL_SRC/run-sbcl.sh --script script.lisp
gcc -Wall -fPIC -shared -o libcalc.dll libcalc.c -Wl,--export-all-symbols -Wl,--whole-archive -lsbcl -Wl,--no-whole-archive -ladvapi32 -lsynchronization -lws2_32 -lzstd
gcc -Wall -o example example.c -lcalc
echo "(+ 1 2)" | ./example.exe
gcc -Wall -fPIC -shared -Wl,--export-all-symbols -o libcalc.dll libcalc.c -Wl,--whole-archive $SBCL_SRC/src/runtime/libsbcl.a -Wl,--no-whole-archive -ladvapi32 -lsynchronization -lws2_32 -lzstd
gcc -Wall -o example example.c -lcalc -L.
mv libcalc.dll $MSYSTEM_PREFIX/bin
cp libcalc.core $MSYSTEM_PREFIX/bin
echo "(+ 1 2)" | ./example.exe
echo "(+ 1 2)" | python ./example.py
12 changes: 9 additions & 3 deletions examples/libcalc/script.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

(asdf:load-system '#:libcalc)

(when (uiop:getenv "CI")
(push :github-ci *features*))

(in-package #:sbcl-librarian/example/libcalc)

(build-bindings libcalc ".")
(build-python-bindings libcalc ".")
(build-core-and-die libcalc "." :compression nil)
(let ((sbcl-librarian::*non-static-lossage-handler* t))
(build-bindings libcalc ".")
(build-python-bindings libcalc "." :library-path
#+(and github-ci win32) (concatenate 'string (uiop:getenv "MSYSTEM_PREFIX") "/bin/libcalc.dll")
#+(and github-ci linux) "/usr/local/lib/libcalc.so"
#+(and github-ci darwin) nil)
(build-core-and-die libcalc "." :compression nil))

0 comments on commit 9cd4c23

Please sign in to comment.