From 4bda7d91886081fc3ec46e652378dbc4f736f86e Mon Sep 17 00:00:00 2001 From: TatriX Date: Wed, 4 Aug 2021 10:33:41 +0200 Subject: [PATCH] Add CI using github actions --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ sdl2-tutorial.asd | 9 ++++++++- tests/test.ros | 17 +++++++++++++++++ tests/tests.lisp | 7 +++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100755 tests/test.ros create mode 100644 tests/tests.lisp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4231d4d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: [push] + +jobs: + test: + name: ${{ matrix.lisp }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + lisp: [sbcl-bin] + os: [ubuntu-latest] # , macOS-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install SDL2 + run: | + sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev + + - name: Install Roswell + env: + LISP: ${{ matrix.lisp }} + run: | + curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh + + - name: Run tests + run: | + ./tests/test.ros diff --git a/sdl2-tutorial.asd b/sdl2-tutorial.asd index bb38823..7f6e217 100644 --- a/sdl2-tutorial.asd +++ b/sdl2-tutorial.asd @@ -20,4 +20,11 @@ (:file "13/tutorial-13") (:file "14/tutorial-14") (:file "15/tutorial-15") - (:file "16/tutorial-16"))) + (:file "16/tutorial-16")) + :in-order-to ((test-op (test-op "sdl2-tutorial/tests")))) + + +(defsystem "sdl2-tutorial/tests" + :depends-on ("parachute") + :components ((:file "tests/tests")) + :perform (test-op (op c) (symbol-call :parachute :test :sdl2-tutorial-tests))) diff --git a/tests/test.ros b/tests/test.ros new file mode 100755 index 0000000..d47c6c2 --- /dev/null +++ b/tests/test.ros @@ -0,0 +1,17 @@ +#!/bin/sh +#|-*- mode:lisp -*-|# +#| +exec ros -Q -- $0 "$@" +|# +(progn ;;init forms + (ros:ensure-asdf) + #+quicklisp(ql:quickload '(sdl2-tutorial sdl2-tutorial/tests) :silent t)) + +(defpackage :ros.script.test + (:use :cl)) +(in-package :ros.script.test) + +(defun main (&rest argv) + (declare (ignorable argv)) + (asdf:test-system :sdl2-tutorial)) +;;; vim: set ft=lisp lisp: diff --git a/tests/tests.lisp b/tests/tests.lisp new file mode 100644 index 0000000..f735303 --- /dev/null +++ b/tests/tests.lisp @@ -0,0 +1,7 @@ +(defpackage #:sdl2-tutorial-tests + (:use :cl :parachute)) + +(in-package #:sdl2-tutorial-tests) + +(define-test hello + (true t))