Skip to content

Commit

Permalink
add GitHubActions (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivixvi authored Jan 4, 2025
1 parent 475633f commit 4a10dc7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'CI'

on:
push:
branches:
- 'main'
pull_request:

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
lisp:
- sbcl-bin

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

steps:
- uses: actions/checkout@v4
- uses: 40ants/setup-lisp@v4
with:
asdf-system: greeting
- uses: 40ants/run-tests@v2
with:
asdf-system: greeting
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Common Lisp Development Environments For VSCode

- https://roswell.github.io/

### GitHub Actions

- https://github.com/40ants/setup-lisp
- https://github.com/40ants/run-tests

## tests for example package

### dependencies install
Expand All @@ -25,5 +30,5 @@ ros install rove
### Usage

```sh
rove tests/main.lisp
rove greeting.asd
```
8 changes: 5 additions & 3 deletions greeting.asd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
(asdf:defsystem "greeting"
:components ((:file "main")))
:components ((:file "main"))
:in-order-to ((test-op (test-op "greeting/tests"))))

(asdf:defsystem "greeting/tests"
:depends-on ("greeting")
:depends-on ("greeting" "rove")
:pathname "tests/"
:components ((:file "main")))
:components ((:file "main"))
:perform (test-op (o c) (symbol-call :greeting/tests :run-test)))
7 changes: 6 additions & 1 deletion tests/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
:greeting))
(in-package :greeting/tests)

(rove:deftest greeting-test
(rove:deftest test-hello
(testing "hello common lisp"
(ok (string= (greeting:hello "common lisp") "Hello common lisp!"))))

(defun run-test ()
(unless
(rove:run :greeting/tests)
(error "Failed tests.")))

0 comments on commit 4a10dc7

Please sign in to comment.