Skip to content

Commit

Permalink
[ci] add macos and slight fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
digikar99 committed May 12, 2024
1 parent 0b80b7f commit ca81752
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 13 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/CI.yml → .github/workflows/CI-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ jobs:
strategy:
matrix:
lisp: [sbcl, ccl, ecl]
os: [ubuntu-22.04, macos-14]
exclude:
- lisp: ccl
os: macos-14
- lisp: ecl
os: macos-14
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 8

Expand Down Expand Up @@ -50,12 +45,15 @@ jobs:
- name: Install python modules
run: | # need to use sudo
sudo apt install python3-pip
python3 -m venv ./py4cl2-cffi/
source ./py4cl2-cffi/bin/activate
pip3 install numpy
pip3 install networkx
pip3 install matplotlib
- name: Run python-config
run: |
source ./py4cl2-cffi/bin/activate
python3 --version
python3-config --libs
python3-config --includes
Expand All @@ -64,6 +62,7 @@ jobs:
- name: Download download-dependencies
run: |
source ./py4cl2-cffi/bin/activate
git clone https://github.com/digikar99/download-dependencies $HOME/quicklisp/local-projects/download-dependencies
Expand Down Expand Up @@ -100,9 +99,13 @@ jobs:
/"$EXOTIC_DIR_PYTHON" --version
- name: Compile Tests
run: cl --load "$EXOTIC_DIR/$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-pre-test.lisp"
run: |
source ./py4cl2-cffi/bin/activate
cl --load "$EXOTIC_DIR/$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-pre-test.lisp"
# Testing it on the second load confirms that functionalities do not
# solely eval-when compile-toplevel, and that they persist across multiple loads.
- name: Run Tests
run: cl --load "$EXOTIC_DIR/$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-test.lisp" || cl --load "$EXOTIC_DIR/$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-test.lisp"
run: |
source ./py4cl2-cffi/bin/activate
cl --load "$EXOTIC_DIR/$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-test.lisp" || cl --load "$EXOTIC_DIR/$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-test.lisp"
97 changes: 97 additions & 0 deletions .github/workflows/CI-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
on: [push, pull_request]

jobs:

test:

name: ${{ matrix.lisp }}, ${{ matrix.os }}

strategy:
matrix:
lisp: [sbcl]
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
timeout-minutes: 3

continue-on-error: true

steps:

- uses: actions/checkout@v2

- name: Update $PATH
run: |
echo $PATH
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
- name: Check $PATH
run: echo $PATH

- name: Download implementation
env:
LISP: ${{ matrix.lisp }}
OS: ${{ matrix.os }}
run: |
pwd
ls -l
bash <(curl -s https://raw.githubusercontent.com/digikar99/lisp-travis-lite/master/run.sh)
- name: Test without numpy
run: |
ls
cl --eval '(push #P"./" ql:*local-project-directories*)' --eval '(ql:quickload "py4cl2-cffi")' --eval '(assert (= 5 (py4cl2-cffi:pyeval 5)))' --eval '(print py4cl2-cffi:*internal-features*)'
# We avoid caching the apt and python modules; need to deal with recursive dependencies

- name: Install python modules
run: |
brew install [email protected]
python -m ensurepip --upgrade
python3 -m venv ./py4cl2-cffi/
source ./py4cl2-cffi/bin/activate
pip3 install numpy
pip3 install networkx
pip3 install matplotlib
- name: Run python-config
run: |
source ./py4cl2-cffi/bin/activate
python3 --version
python3-config --libs
python3-config --includes
python3-config --ldflags
find '/usr/lib' -name "libpython*.so"
- name: Download download-dependencies
run: |
git clone https://github.com/digikar99/download-dependencies $HOME/quicklisp/local-projects/download-dependencies
- name: Download Tests
run: |
git clone https://github.com/digikar99/py4cl2-cffi-tests ./tests
pwd
ls -l
- name: Download Test Dependencies
run: >
cl --eval '(ql:quickload "download-dependencies")' \
--eval '(in-package :download-dependencies)' \
--eval '(push #P"./" ql:*local-project-directories*)' \
--eval '(let ((*dependencies-home* (first ql:*local-project-directories*))) (ensure-system "py4cl2-cffi-tests"))'
- name: Test numpy
run: |
source ./py4cl2-cffi/bin/activate
python3 -c 'import numpy; print(numpy.__version__, numpy.__path__[0])'
- name: Compile Tests
run: |
source ./py4cl2-cffi/bin/activate
cl --load "$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-pre-test.lisp"
# Testing it on the second load confirms that functionalities do not
# solely eval-when compile-toplevel, and that they persist across multiple loads.
- name: Run Tests
run: |
source ./py4cl2-cffi/bin/activate
cl --load "$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-test.lisp" || cl --load "$HOME/work/py4cl2-cffi/py4cl2-cffi/ci-test.lisp"
2 changes: 1 addition & 1 deletion ci-pre-test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; :replace t
;; :prompt nil)
(push :travis *features*)
(push #P"~/" ql:*local-project-directories*)
(push #P"./" ql:*local-project-directories*)
(print (ql:where-is-system "py4cl2-cffi"))
(ql:quickload "py4cl2-cffi-tests")
(uiop:quit 0)
9 changes: 5 additions & 4 deletions ci-test.lisp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(in-package :cl-user)
(push :travis *features*)
(push (print (pathname (uiop:getenv "EXOTIC_DIR")))
ql:*local-project-directories*)
(push #P"~/" ql:*local-project-directories*)
(push :ci *features*)
(when (eq :linux (uiop:operating-system))
(push (print (pathname (uiop:getenv "EXOTIC_DIR")))
ql:*local-project-directories*))
(push #P"./" ql:*local-project-directories*)
(ql:quickload "py4cl2-cffi-tests")
(py4cl2-cffi/config:print-configuration)
(let ((report (py4cl2-cffi-tests:run)))
Expand Down

0 comments on commit ca81752

Please sign in to comment.