Skip to content

Commit

Permalink
Merge pull request #4 from 40ants/fix-gh-action-warnings
Browse files Browse the repository at this point in the history
Temporarily disabled matrix.
  • Loading branch information
svetlyak40wt committed Nov 10, 2022
2 parents 7a9c159 + 2acd587 commit d349c21
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 58 deletions.
126 changes: 115 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"steps": [
{
"name": "Checkout Code",
"uses": "actions/checkout@v2"
"uses": "actions/checkout@v3"
},
{
"name": "Grant All Perms to Make Cache Restoring Possible",
Expand All @@ -34,13 +34,13 @@
{
"name": "Get Current Month",
"id": "current-month",
"run": "echo \"::set-output name=value::$(date -u \"+%Y-%m\")\"",
"run": "echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT",
"shell": "bash"
},
{
"name": "Cache Roswell Setup",
"id": "cache",
"uses": "actions/cache@v2",
"uses": "actions/cache@v3",
"with": {
"path": "qlfile\nqlfile.lock\n~/.cache/common-lisp/\n~/.roswell\n/usr/local/etc/roswell\n/usr/local/bin/ros\n/usr/local/Cellar/roswell\n.qlot",
"key": "a-${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-ubuntu-latest-quicklisp-sbcl-bin-${{ hashFiles('qlfile.lock', '*.asd') }}"
Expand All @@ -67,7 +67,7 @@
},
{
"name": "Update Qlot",
"run": "qlot update || qlot update",
"run": "qlot update --no-deps",
"shell": "bash"
},
{
Expand All @@ -77,7 +77,7 @@
},
{
"name": "Run Linter",
"run": "qlot exec 40ants-linter --system \"40ants-asdf-system-docs\" --imports",
"run": "qlot exec 40ants-linter --system \"40ants-asdf-system-docs, 40ants-asdf-system-tests\" --imports",
"shell": "bash"
}
]
Expand All @@ -95,12 +95,11 @@
"quicklisp"
],
"lisp": [
"sbcl",
"sbcl-bin",
"ccl-bin/1.12.1",
"abcl-bin",
"allegro",
"clasp",
"clisp",
"lispworks",
"mkcl",
"npt",
Expand All @@ -116,6 +115,111 @@
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "npt"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "ccl-bin/1.12.1"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "ccl-bin/1.12.1"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "ccl-bin/1.12.1"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "abcl-bin"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "abcl-bin"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "abcl-bin"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "allegro"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "allegro"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "allegro"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "clasp"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "clasp"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "clasp"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "lispworks"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "lispworks"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "lispworks"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "mkcl"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "mkcl"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "mkcl"
},
{
"os": "ubuntu-latest",
"quicklisp": "quicklisp",
"lisp": "ecl"
},
{
"os": "macos-latest",
"quicklisp": "quicklisp",
"lisp": "ecl"
},
{
"os": "macos-latest",
"quicklisp": "ultralisp",
"lisp": "ecl"
}
]
}
Expand All @@ -129,7 +233,7 @@
"steps": [
{
"name": "Checkout Code",
"uses": "actions/checkout@v2"
"uses": "actions/checkout@v3"
},
{
"name": "Grant All Perms to Make Cache Restoring Possible",
Expand All @@ -139,13 +243,13 @@
{
"name": "Get Current Month",
"id": "current-month",
"run": "echo \"::set-output name=value::$(date -u \"+%Y-%m\")\"",
"run": "echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT",
"shell": "bash"
},
{
"name": "Cache Roswell Setup",
"id": "cache",
"uses": "actions/cache@v2",
"uses": "actions/cache@v3",
"with": {
"path": "qlfile\nqlfile.lock\n~/.cache/common-lisp/\n~/.roswell\n/usr/local/etc/roswell\n/usr/local/bin/ros\n/usr/local/Cellar/roswell\n.qlot",
"key": "a-${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.quicklisp }}-${{ matrix.lisp }}-${{ hashFiles('qlfile.lock', '*.asd') }}"
Expand Down Expand Up @@ -176,4 +280,4 @@
]
}
}
}
}
11 changes: 11 additions & 0 deletions 40ants-asdf-system-tests.asd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(defsystem "40ants-asdf-system-tests"
:author "Alexander Artemenko"
:license "BSD"
:class :package-inferred-system
:pathname "t"
:depends-on ("40ants-asdf-system-tests/core")
:description "Test system for 40ants-asdf-system."

:perform (test-op (op c)
(unless (symbol-call :rove :run c)
(error "Tests failed"))))
4 changes: 3 additions & 1 deletion 40ants-asdf-system.asd
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
:components ((:module "src"
:components ((:file "package")
(:file "version" :depends-on ("package"))
(:file "system" :depends-on ("version"))))))
(:file "readme" :depends-on ("package"))
(:file "system" :depends-on ("version")))))
:in-order-to ((test-op (test-op "40ants-asdf-system-tests"))))
2 changes: 1 addition & 1 deletion qlfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dist ultralisp http://dist.ultralisp.org/
dist ultralisp http://dist.ultralisp.org
4 changes: 2 additions & 2 deletions qlfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
:version "2022-11-07"))
("ultralisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "http://dist.ultralisp.org/" :%version :latest)
:version "20221107160500"))
:initargs (:distribution "http://dist.ultralisp.org" :%version :latest)
:version "20221110152000"))
51 changes: 34 additions & 17 deletions src/ci.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,52 @@
#:build-docs))
(in-package #:40ants-asdf-system/ci)

(defparameter *lisp-implementations*
(list "sbcl-bin"
"ccl-bin/1.12.1"
"abcl-bin"
"allegro"
"clasp"
;; This CL implementation does not work in any matrix combinations
;; "cmu-bin"
"lispworks"
"mkcl"
"npt"
"ecl") )


(defworkflow ci
:on-push-to "master"
:by-cron "0 10 * * 1"
:on-pull-request t
:cache t
:jobs ((linter :asdf-systems ("40ants-asdf-system-docs")
:jobs ((linter :asdf-systems ("40ants-asdf-system-docs"
"40ants-asdf-system-tests")
:check-imports t)
(run-tests
:os ("ubuntu-latest"
"macos-latest")
:quicklisp ("ultralisp"
"quicklisp")
:lisp ("sbcl"
"ccl-bin/1.12.1"
"abcl-bin"
"allegro"
"clasp"
"clisp"
;; This CL implementation does not work in any matrix combinations
;; "cmu-bin"
"lispworks"
"mkcl"
;; ubuntu, ultralisp|quicklisp
"npt"
"ecl")
;; These combinations are failed for some reason:
:exclude ((:os "ubuntu-latest" :quicklisp "ultralisp" :lisp "npt")
(:os "ubuntu-latest" :quicklisp "quicklisp" :lisp "npt"))
:lisp *lisp-implementations*
:exclude (append
;; These combinations are failed for some reason:
'((:os "ubuntu-latest" :quicklisp "ultralisp" :lisp "npt")
(:os "ubuntu-latest" :quicklisp "quicklisp" :lisp "npt"))
;; All implementations except SBCL and NPT we'll check only on Linux
;; and Ultralisp dist.
(loop for lisp in *lisp-implementations*
unless (or (string-equal lisp "sbcl-bin")
(string-equal lisp "npt"))
append (list (list :os "ubuntu-latest"
:quicklisp "quicklisp"
:lisp lisp)
(list :os "macos-latest"
:quicklisp "quicklisp"
:lisp lisp)
(list :os "macos-latest"
:quicklisp "ultralisp"
:lisp lisp))))
:coverage t)))


Expand Down
7 changes: 6 additions & 1 deletion src/package.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
(uiop:define-package #:40ants-asdf-system
(:use #:cl)
(:nicknames #:40ants-asdf-system/system))
(:nicknames #:40ants-asdf-system/system)
(:import-from #:asdf/interface
#:40ants-asdf-system)
(:export #:40ants-asdf-system
#:path-to-changelog
#:path-to-readme))

11 changes: 11 additions & 0 deletions src/readme.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(in-package #:40ants-asdf-system)


(defun retrieve-system-readme (system)
(let* ((filename (let ((path (path-to-readme system)))
(etypecase path
(string (uiop:parse-unix-namestring path))
(pathname path))))
(full-path (asdf:system-relative-pathname system filename)))
(when (probe-file full-path)
(uiop:read-file-string full-path))))
53 changes: 28 additions & 25 deletions src/system.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@


(defclass asdf/interface::40ants-asdf-system (asdf/interface:package-inferred-system)
((version-from-changelog :initform nil
:type (or null string)
:reader asdf:component-version
:documentation "This slot is used instead of asdf/component:version because it is overwritten by ASDF function parse-component-form and there is no other way to save a version from the changelog."))
((path-to-changelog :initform "docs/changelog.lisp"
:initarg :path-to-changelog
:type (or string pathname)
:documentation "System relative path to a changelog, if string is given, then it will be processed using uiop:parse-unix-namestring function."
:reader path-to-changelog)
(path-to-readme :initform "README.md"
:initarg :path-to-readme
:type (or string pathname)
:documentation "System relative path to a README.md, if string is given, then it will be processed using uiop:parse-unix-namestring function."
:reader path-to-readme))
(:documentation "This ASDF system class takes it's version from src/changelog.lisp"))


(defmethod shared-initialize :after ((system asdf/interface::40ants-asdf-system) slot-names &rest rest)
(declare (ignore rest slot-names))
(unless (asdf:component-version system)
(let ((filenames (list (make-pathname :directory (list :relative "src")
:name "changelog"
:type "lisp")
(make-pathname :directory (list :relative "src" "doc")
:name "changelog"
:type "lisp")
(make-pathname :directory (list :relative "docs")
:name "changelog"
:type "lisp")
(make-pathname :name "changelog"
:type "lisp"))))
(loop for filename in filenames
for full-path = (asdf:system-relative-pathname system filename)
when (probe-file full-path)
do (let ((version (extract-version-from-changelog full-path)))
(when version
(setf (slot-value system 'version-from-changelog)
version)))))))

(defmethod asdf:operate :after ((op asdf:define-op) (system asdf/interface::40ants-asdf-system) &rest rest)
(declare (ignore rest))
(let ((version nil))
(flet ((get-version ()
(or version
(setf version
(retrieve-system-version system)))))
(unless (asdf:component-version system)
(setf (asdf:component-version system)
(get-version)))

(unless (asdf:system-version system)
(setf (slot-value system 'asdf:version)
(get-version)))

(unless (asdf:system-long-description system)
(setf (slot-value system 'asdf::long-description)
(retrieve-system-readme system))))))
10 changes: 10 additions & 0 deletions src/version.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@
(version-symbol (car version-form))
(version (symbol-name version-symbol)))
version))))


(defun retrieve-system-version (system)
(let* ((filename (let ((path (path-to-changelog system)))
(etypecase path
(string (uiop:parse-unix-namestring path))
(pathname path))))
(full-path (asdf:system-relative-pathname system filename)))
(when (probe-file full-path)
(extract-version-from-changelog full-path))))
Loading

0 comments on commit d349c21

Please sign in to comment.