Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v1",
"with": {
"asdf-system": "40ants-ci"
"asdf-system": "40ants-ci",
"asdf-version": "3.3.5.1"
},
"if": "steps.cache.outputs.cache-hit != 'true'"
},
Expand Down Expand Up @@ -142,6 +143,7 @@
"uses": "40ants/setup-lisp@v1",
"with": {
"asdf-system": "40ants-ci",
"asdf-version": "3.3.5.1",
"qlfile-template": "{% ifequal quicklisp_dist \"ultralisp\" %}\ndist ultralisp http://dist.ultralisp.org\n{% endifequal %}"
},
"if": "steps.cache.outputs.cache-hit != 'true'"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"master"
]
},
"pull_request": null,
"schedule": [
{
"cron": "0 10 * * 1"
Expand Down Expand Up @@ -55,7 +56,8 @@
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v1",
"with": {
"asdf-system": "40ants-ci"
"asdf-system": "40ants-ci",
"asdf-version": "3.3.5.1"
},
"if": "steps.cache.outputs.cache-hit != 'true'"
},
Expand Down
3 changes: 3 additions & 0 deletions src/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

(defchangelog (:ignore-words ("40ANTS-DOC"
"ASDF"))
(0.3.0 2021-10-24
"- Now jobs 40ANTS-CI/JOBS/LINTER:LINTER, 40ANTS-CI/JOBS/RUN-TESTS:RUN-TESTS and 40ANTS-CI/JOBS/DOCS:BUILD-DOCS
support ASDF-VERSION argument.")
(0.2.2 2021-06-18
"- Fixed an occasional failure on `qlot update` inside linter workflow.
Usually it happed when quicklisp distribution was updated and `qlfile.lock`
Expand Down
14 changes: 11 additions & 3 deletions src/ci.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,27 @@
(in-package 40ants-ci/ci)


(defparameter *asdf-version* "3.3.5.1"
"At some point installation of the latest roswell version was broken:
https://github.com/roswell/roswell/issues/497")


(defworkflow docs
:on-push-to "master"
:on-pull-request t
:by-cron "0 10 * * 1"
:cache t
:jobs ((40ants-ci/jobs/docs:build-docs)))
:jobs ((40ants-ci/jobs/docs:build-docs
:asdf-version *asdf-version*)))


(defworkflow ci
:on-push-to "master"
:by-cron "0 10 * * 1"
:on-pull-request t
:cache t
:jobs ((40ants-ci/jobs/linter:linter)
:jobs ((40ants-ci/jobs/linter:linter
:asdf-version *asdf-version*)
;; (run-tests
;; :custom (error "This run should fail!"))
(run-tests
Expand All @@ -35,7 +43,7 @@
"ultralisp")
:lisp ("sbcl-bin"
"ccl-bin")

:asdf-version *asdf-version*
:coverage t
:qlfile "{% ifequal quicklisp_dist \"ultralisp\" %}
dist ultralisp http://dist.ultralisp.org
Expand Down
10 changes: 8 additions & 2 deletions src/core.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#:defsection-copy)
(:import-from #:40ants-ci/github)
(:import-from #:40ants-ci/jobs/docs)
(:import-from #:40ants-ci/jobs/linter)
(:import-from #:40ants-ci/jobs/run-tests)
(:import-from #:docs-config
#:docs-config)
Expand Down Expand Up @@ -390,7 +391,8 @@ modified .github/workflows/docs.yml
")


(defsection @details (:title "Details")
(defsection @details (:title "Details"
:ignore-words ("ASD"))
"
TODO: I have to write a few chapters with details on additional job's parameters
and a way how to create new job types.
Expand All @@ -401,7 +403,10 @@ and a way how to create new job types.
(40ants-ci/jobs/run-tests:run-tests class)

(40ants-ci/jobs/docs:build-docs function)
(40ants-ci/jobs/docs:build-docs class))
(40ants-ci/jobs/docs:build-docs class)

(40ants-ci/jobs/linter:linter function)
(40ants-ci/jobs/linter:linter class))


(defun generate (system &key path)
Expand All @@ -413,3 +418,4 @@ and a way how to create new job types.
If PATH argument is not given, workflow files will be written
to .github/workflow/ relarive to the SYSTEM."
(40ants-ci/github:generate system path))

6 changes: 4 additions & 2 deletions src/jobs/docs.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@


(defun build-docs (&key asdf-system
(error-on-warnings t))
asdf-version
(error-on-warnings t))
"Creates a job of class BUILD-DOCS."
(make-instance 'build-docs
:asdf-system asdf-system
:error-on-warnings error-on-warnings))
:error-on-warnings error-on-warnings
:asdf-version asdf-version))


(defmethod 40ants-ci/jobs/job:steps ((job build-docs))
Expand Down
8 changes: 4 additions & 4 deletions src/jobs/linter.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#:asdf-system)
(:import-from #:40ants-ci/utils
#:current-system-name)
(:export
#:linter))
(:export #:linter))
(in-package 40ants-ci/jobs/linter)


Expand All @@ -17,7 +16,7 @@
:reader asdf-systems)))


(defun linter (&key asdf-systems)
(defun linter (&key asdf-systems asdf-version)
"Creates a job which will run SBLint for given ASDF systems.

If no ASD files given, it will use all ASD files from
Expand All @@ -27,7 +26,8 @@

(make-instance 'linter
:asdf-system (first asdf-systems)
:asdf-systems asdf-systems))
:asdf-systems asdf-systems
:asdf-version asdf-version))


(defmethod 40ants-ci/jobs/job:steps ((job linter))
Expand Down
9 changes: 8 additions & 1 deletion src/jobs/lisp-job.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
:reader qlfile)
(asdf-system :initarg :asdf-system
:initform nil
:reader asdf-system))
:type (or null string)
:reader asdf-system)
(asdf-version :initarg :asdf-version
:initform nil
:type (or null string)
:documentation "ASDF version to use when setting up Lisp environment. If NIL, then the latest will be used."
:reader asdf-version))
(:documentation "This job checkouts the sources, installs Roswell and Qlot. Also, it caches results between runs."))


Expand Down Expand Up @@ -95,6 +101,7 @@
(action "Setup Common Lisp Environment"
"40ants/setup-lisp@v1"
:asdf-system (asdf-system job)
:asdf-version (asdf-version job)
:qlfile-template (when (qlfile job)
(dedent (qlfile job)))
:if (when *use-cache*
Expand Down
16 changes: 11 additions & 5 deletions src/jobs/run-tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@
(:documentation "This job test runs tests for a given ASDF system."))


(defun run-tests (&rest rest &key coverage qlfile asdf-system
os quicklisp lisp
exclude
custom)
(defun run-tests (&rest rest &key coverage
qlfile
asdf-system
asdf-version
os
quicklisp
lisp
exclude
custom)
"Creates a job step of class RUN-TESTS."
(declare (ignore coverage qlfile os quicklisp lisp asdf-system exclude))
(declare (ignore coverage qlfile os quicklisp lisp
asdf-system asdf-version exclude))
(check-type custom
(or null string list))
(apply #'make-instance 'run-tests
Expand Down
21 changes: 20 additions & 1 deletion src/workflow.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,29 @@
(call-next-method)))


(defun eval-arg (arg)
"Whe use as is following forms:

- (\"foo\" \"bar\" \"baz\")

And eval others:

- \"blah\" -> \"blah\"
- 12345 -> 12345
- (foo 1 2 3) -> result of foo call.
"
(if (and (typep arg 'list)
(not (typep (first arg)
'symbol)))
arg
(eval arg)))


(defun make-job (name)
(let* ((name (uiop:ensure-list name))
(symbol (car name))
(args (cdr name)))
(args (mapcar #'eval-arg
(cdr name))))
(if (fboundp symbol)
(apply symbol args)
(apply #'make-instance symbol args))))
Expand Down