Skip to content

Commit

Permalink
added github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed May 19, 2024
1 parent ad0da18 commit 6ad9a24
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'CI'

on:
push:
branches:
- 'development'
pull_request:

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
lisp:
- sbcl

env:
LISP: ${{ matrix.lisp }}

steps:
- uses: actions/checkout@v2

- name: setup cache folders
run: |
sudo mkdir -p /usr/local/etc/roswell
sudo chown "${USER}" /usr/local/etc/roswell
# Here the ros binary will be restored:
sudo chown "${USER}" /usr/local/bin
- name: current date for quicklisp
id: current-month
run: |
echo "CURRENT_MONTH=$(date -u "+%Y-%m")" >> $GITHUB_OUTPUT
- name: Cache Roswell Setup
id: cache
uses: actions/cache@v2
env:
cache-name: cache-roswell
with:
path: |
/usr/local/bin/ros
/usr/local/etc/roswell
~/.cache/common-lisp/
~/.roswell
.qlot
key: "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('qlfile.lock') }}"

- name: Restore Path To Cached Files
run: |
echo $HOME/.roswell/bin >> $GITHUB_PATH
echo .qlot/bin >> $GITHUB_PATH
if: steps.cache.outputs.cache-hit == 'true'

- uses: 40ants/setup-lisp@v2
if: steps.cache.outputs.cache-hit != 'true'

- name: run
run: |
ros use sbcl
LISP="ros run --" make tests
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ENV?=development

## run through roswell
LISP?=sbcl

LISPFLAGS=--quit --non-interactive

.PHONY: tests
tests:
ENV=$(ENV) \
$(LISP) \
$(LISPFLAGS) --load tests-runner.lisp
12 changes: 12 additions & 0 deletions tests-runner.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(push *default-pathname-defaults* ql:*local-project-directories*)

(quicklisp:quickload :wst.routing.test)

(setf *debugger-hook*
(lambda (c h)
(declare (ignore c h))
(uiop:quit -1))
fiveam:*on-error* :debug)

(unless (fiveam:run-all-tests)
(exit :code 1 :abort t))

0 comments on commit 6ad9a24

Please sign in to comment.