From 26f6d6fb2c05d8be3723a486e91ed6be807c3b68 Mon Sep 17 00:00:00 2001 From: Kartik Singh Date: Sun, 12 May 2024 14:39:05 -0400 Subject: [PATCH] Add Linux workflow --- .github/workflows/linux.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..3501e04c --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,43 @@ +name: Linux + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/checkout@v1 + with: + repository: sbcl/sbcl + ref: sbcl-2.4.4 + path: sbcl + - name: install host sbcl + run: | + sudo apt-get -qq update | true + sudo apt-get -qq install sbcl libcapstone-dev + - name: build sbcl + env: + SBCL_MAKE_TARGET_2_OPTIONS: --disable-ldb --disable-debugger + run: | + ./make.sh --xc-host='sbcl --dynamic-space-size 700MB --lose-on-corruption --disable-ldb --disable-debugger' + ./make-shared-library.sh + - name: install quicklisp + working-directory: ../sbcl + run: | + curl -O https://beta.quicklisp.org/quicklisp.lisp + ./run-sbcl.sh --load quicklisp.lisp --eval "(quicklisp-quickstart:install)" --eval "(ql-util:without-prompting (ql:add-to-init-file))" --eval "(quit)" + - name: build and run example + working-directory: examples/libcalc + env: + SBCL_SRC: ${{ github.workspace }}/../sbcl + LD_LIBRARY_PATH: ${{ github.workspace }}/../sbcl/src/runtime:. + 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 + echo "(+ 1 2)" | ./example + \ No newline at end of file