-
Notifications
You must be signed in to change notification settings - Fork 1
/
docs.lisp
175 lines (138 loc) · 4.42 KB
/
docs.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
(defpackage #:docs/docs
(:use #:cl)
(:import-from #:40ants-doc
#:defsection
#:defsection-copy)
(:import-from #:docs/changelog
#:@changelog)
(:import-from #:docs-config
#:docs-config)
(:export #:@index
#:@readme
#:@changelog))
(in-package docs/docs)
(defmethod docs-config ((system (eql (asdf:find-system "docs"))))
;; 40ANTS-DOC-THEME-40ANTS system will bring
;; as dependency a full 40ANTS-DOC but we don't want
;; unnecessary dependencies here:
(ql:quickload :40ants-doc-theme-40ants)
(list :theme
(find-symbol "40ANTS-THEME"
(find-package "40ANTS-DOC-THEME-40ANTS"))))
(defsection @index (:title "GitHub Action to Run Tests for a Common Lisp Library"
:ignore-words ("SBCL"
"CCL"
"ASDF"))
"
This is a Github Action can be used to run tests for any Common Lisp supporting `(asdf:test-system :my-system)`.
It should be used after the [setup-lisp](https://40ants.com/setup-lisp/) action.
"
(@features section)
(@typical-usage section)
(@custom-test-runner section)
(@coveralls section)
(@roadmap section))
(defsection-copy @readme @index)
(defsection @features (:title "What this action does for you?")
"
* It runs (asdf:test-system :the-system-name) by default.
* But you can provide your own lisp code.
* It automatically searches a test system name if it is present.
")
(defsection @typical-usage (:title "A typical usage")
"
Here is how a minimal GitHub Workflow might look like:
```yaml
name: 'CI'
on:
push:
branches:
- 'main'
- 'master'
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
lisp:
- sbcl-bin
- ccl-bin
env:
LISP: ${{ matrix.lisp }}
steps:
- uses: actions/checkout@v1
- uses: 40ants/setup-lisp@v4
with:
asdf-system: cl-info
- uses: 40ants/run-tests@v2
with:
asdf-system: cl-info
```
The part, corresponding to an action call is:
```yaml
- uses: 40ants/run-tests@v2
with:
asdf-system: cl-info
```
Here we provided a system name `cl-info`, but
action is smart enough to detect that really
there is a separate `cl-info-test` ASDF system.
To guess a system name to run tests against, action
will check `${asdf-system}-test`, `${asdf-system}-tests`,
`${asdf-system}/test` and `${asdf-system}/tests`. And if none
of them found - fall back to `${asdf-system}`.
**Please, note, that `(asdf:test-system :your-system-name)`
should signal error in case if some tests were failed.** Only
in this case action will exit with error code.
")
(defsection @custom-test-runner (:title "Custom test runner")
"
Sometimes you might want to use something special instead of
`(asdf:test-system :your-system-name)`. You can pass any lisp
code to the action:
```
- uses: 40ants/run-tests@v2
with:
asdf-system: cl-info
run-tests: |
(ql:quickload :cl-info-test)
(unless (rove:run :cl-info-test)
(error \"Tests failed\"))
```
")
(defsection @coveralls (:title "Publishing reports to Coveralls")
"
This action automates coverage collection and reporting. To publish report
to the [Coveralls](https://coveralls.io/), pass your github token as
a `coveralls-token` argument:
```yaml
- uses: 40ants/run-tests@v2
with:
asdf-system: cl-info
coveralls-token: ${{ secrets.github_token }}
```
If you are using \"matrix\", then it is good idea to collect coverage report
only on one matrix combination. To do this, use a logical expression which
will check some variables and returns a token only if all of them are true:
```yaml
- uses: 40ants/run-tests@v2
with:
asdf-system: cl-info
coveralls-token: |
${{ matrix.lisp == 'sbcl-bin' &&
matrix.os == 'ubuntu-latest' &&
matrix.quicklisp-dist == 'ultralisp' &&
secrets.github_token }}
```
Here is an example how your report on Coveralls can look like:
https://coveralls.io/github/40ants/cl-info
**Note**, that coverage reporting currently works only on SBCL and CCL 1.4.
You can contribute support for other implementations to
[cl-coveralls](https://github.com/fukamachi/cl-coveralls).
")
(defsection @roadmap (:title "Roadmap")
"
- Support uploading code coverage reports to CodeCov.
- Vendor all dependencies, to make action more reliable and secure.
")