From 96c4e6968d6736f908e440b2a0cd18e4b35eb19a Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 9 Nov 2022 22:16:54 +0300 Subject: [PATCH 01/20] Temporarily disabled matrix. --- .github/workflows/ci.yml | 49 +++++----------------------------------- src/ci.lisp | 29 +++++++++++++----------- 2 files changed, 22 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87a4b49..b288cfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,48 +83,11 @@ ] }, "run-tests": { - "strategy": { - "fail-fast": false, - "matrix": { - "os": [ - "ubuntu-latest", - "macos-latest" - ], - "quicklisp": [ - "ultralisp", - "quicklisp" - ], - "lisp": [ - "sbcl", - "ccl-bin/1.12.1", - "abcl-bin", - "allegro", - "clasp", - "clisp", - "lispworks", - "mkcl", - "npt", - "ecl" - ], - "exclude": [ - { - "os": "ubuntu-latest", - "quicklisp": "ultralisp", - "lisp": "npt" - }, - { - "os": "ubuntu-latest", - "quicklisp": "quicklisp", - "lisp": "npt" - } - ] - } - }, - "runs-on": "${{ matrix.os }}", + "runs-on": "ubuntu-latest", "env": { - "OS": "${{ matrix.os }}", - "QUICKLISP_DIST": "${{ matrix.quicklisp }}", - "LISP": "${{ matrix.lisp }}" + "OS": "ubuntu-latest", + "QUICKLISP_DIST": "ultralisp", + "LISP": "sbcl" }, "steps": [ { @@ -148,7 +111,7 @@ "uses": "actions/cache@v2", "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') }}" + "key": "a-${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-ubuntu-latest-ultralisp-sbcl-${{ hashFiles('qlfile.lock', '*.asd') }}" } }, { @@ -170,7 +133,7 @@ "uses": "40ants/run-tests@v2", "with": { "asdf-system": "40ants-asdf-system", - "coveralls-token": "\n${{ matrix.lisp == 'sbcl-bin' &&\n matrix.os == 'ubuntu-latest' &&\n matrix.quicklisp == 'ultralisp' &&\n secrets.github_token }}" + "coveralls-token": "${{ secrets.github_token }}" } } ] diff --git a/src/ci.lisp b/src/ci.lisp index 27cf76e..5705fc6 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -20,25 +20,28 @@ :check-imports t) (run-tests :os ("ubuntu-latest" - "macos-latest") + ;; "macos-latest" + ) :quicklisp ("ultralisp" - "quicklisp") + ;; "quicklisp" + ) :lisp ("sbcl" - "ccl-bin/1.12.1" - "abcl-bin" - "allegro" - "clasp" - "clisp" + ;; "ccl-bin/1.12.1" + ;; "abcl-bin" + ;; "allegro" + ;; "clasp" + ;; "clisp" ;; This CL implementation does not work in any matrix combinations ;; "cmu-bin" - "lispworks" - "mkcl" + ;; "lispworks" + ;; "mkcl" ;; ubuntu, ultralisp|quicklisp - "npt" - "ecl") + ;; "npt" + ;; "ecl" + ) ;; These combinations are failed for some reason: - :exclude ((:os "ubuntu-latest" :quicklisp "ultralisp" :lisp "npt") - (:os "ubuntu-latest" :quicklisp "quicklisp" :lisp "npt")) + ;; :exclude ((:os "ubuntu-latest" :quicklisp "ultralisp" :lisp "npt") + ;; (:os "ubuntu-latest" :quicklisp "quicklisp" :lisp "npt")) :coverage t))) From 1a583609e0a6c08d0ae241307df9db0b65c49927 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 9 Nov 2022 22:19:14 +0300 Subject: [PATCH 02/20] Move to cache v3. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b288cfd..b47f1c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ { "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') }}" @@ -108,7 +108,7 @@ { "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-ultralisp-sbcl-${{ hashFiles('qlfile.lock', '*.asd') }}" @@ -139,4 +139,4 @@ ] } } -} \ No newline at end of file +} From ae8e2f15e4a29f4d98a6a06b360f3434812820f5 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 9 Nov 2022 22:22:02 +0300 Subject: [PATCH 03/20] Test checkout@v3. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b47f1c9..c5db9cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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", @@ -92,7 +92,7 @@ "steps": [ { "name": "Checkout Code", - "uses": "actions/checkout@v2" + "uses": "actions/checkout@v3" }, { "name": "Grant All Perms to Make Cache Restoring Possible", From e93f3c321bb909ea678eae68e2e9e2ba12ae5d3e Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 9 Nov 2022 22:32:35 +0300 Subject: [PATCH 04/20] Trying new version of set outpu. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5db9cb..adce596 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ { "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" }, { @@ -102,7 +102,7 @@ { "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" }, { From f18db5f08d307b52e0ece7289057fad6c97f9c8f Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 9 Nov 2022 22:38:16 +0300 Subject: [PATCH 05/20] Checking rocket output. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adce596..6c6595c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,6 +135,11 @@ "asdf-system": "40ants-asdf-system", "coveralls-token": "${{ secrets.github_token }}" } + }, + { + "name": "Test OUTPUT", + "run": "echo \"### Hello world! :rocket:\" >> $GITHUB_STEP_SUMMARY", + "shell": "bash", } ] } From 457b1f60b868b27019166601013f6bf54a31bf8a Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 00:34:20 +0300 Subject: [PATCH 06/20] Added one test. --- .github/workflows/ci.yml | 9 ++------- 40ants-asdf-system-tests.asd | 11 +++++++++++ 40ants-asdf-system.asd | 3 ++- src/ci.lisp | 3 ++- src/system.lisp | 20 ++------------------ src/version.lisp | 20 ++++++++++++++++++++ t/core.lisp | 18 ++++++++++++++++++ 7 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 40ants-asdf-system-tests.asd create mode 100644 t/core.lisp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c6595c..5e9a379 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" } ] @@ -135,13 +135,8 @@ "asdf-system": "40ants-asdf-system", "coveralls-token": "${{ secrets.github_token }}" } - }, - { - "name": "Test OUTPUT", - "run": "echo \"### Hello world! :rocket:\" >> $GITHUB_STEP_SUMMARY", - "shell": "bash", } ] } } -} +} \ No newline at end of file diff --git a/40ants-asdf-system-tests.asd b/40ants-asdf-system-tests.asd new file mode 100644 index 0000000..2bf1e5c --- /dev/null +++ b/40ants-asdf-system-tests.asd @@ -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")))) diff --git a/40ants-asdf-system.asd b/40ants-asdf-system.asd index 9802d05..0ca96ab 100644 --- a/40ants-asdf-system.asd +++ b/40ants-asdf-system.asd @@ -11,4 +11,5 @@ :components ((:module "src" :components ((:file "package") (:file "version" :depends-on ("package")) - (:file "system" :depends-on ("version")))))) + (:file "system" :depends-on ("version"))))) + :in-order-to ((test-op (test-op "40ants-asdf-system-tests")))) diff --git a/src/ci.lisp b/src/ci.lisp index 5705fc6..705188b 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -16,7 +16,8 @@ :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" diff --git a/src/system.lisp b/src/system.lisp index 714e6ef..03e6412 100644 --- a/src/system.lisp +++ b/src/system.lisp @@ -12,22 +12,6 @@ (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))))))) + (setf (slot-value system 'version-from-changelog) + (retrieve-system-version system)))) diff --git a/src/version.lisp b/src/version.lisp index 4208572..03e6f85 100644 --- a/src/version.lisp +++ b/src/version.lisp @@ -21,3 +21,23 @@ (version-symbol (car version-form)) (version (symbol-name version-symbol))) version)))) + + +(defun retrieve-system-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 + (return-from retrieve-system-version version)))))) diff --git a/t/core.lisp b/t/core.lisp new file mode 100644 index 0000000..e735350 --- /dev/null +++ b/t/core.lisp @@ -0,0 +1,18 @@ +(uiop:define-package #:40ants-asdf-system-tests/core + (:use #:cl) + (:import-from #:40ants-asdf-system + #:retrieve-system-version) + (:import-from #:hamcrest/rove + #:contains + #:assert-that) + (:import-from #:rove + #:testing + #:ok + #:deftest)) +(in-package #:40ants-asdf-system-tests/core) + + +(deftest test-version-extraction + (testing "Checking if it is possible to extract version from our changelog" + (ok (equal (retrieve-system-version (asdf:find-system "40ants-asdf-system")) + "0.1.0")))) From f526a58943a1d0612c6c7ea92e988542f3fc1826 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 01:01:59 +0300 Subject: [PATCH 07/20] Removed hamcrest. --- t/core.lisp | 3 --- 1 file changed, 3 deletions(-) diff --git a/t/core.lisp b/t/core.lisp index e735350..95e1507 100644 --- a/t/core.lisp +++ b/t/core.lisp @@ -2,9 +2,6 @@ (:use #:cl) (:import-from #:40ants-asdf-system #:retrieve-system-version) - (:import-from #:hamcrest/rove - #:contains - #:assert-that) (:import-from #:rove #:testing #:ok From 78816472b7e1da14d853a5c3315fda996abaa091 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 01:20:42 +0300 Subject: [PATCH 08/20] Changed a line just to check if caching working. --- t/core.lisp | 1 + 1 file changed, 1 insertion(+) diff --git a/t/core.lisp b/t/core.lisp index 95e1507..5c2da82 100644 --- a/t/core.lisp +++ b/t/core.lisp @@ -9,6 +9,7 @@ (in-package #:40ants-asdf-system-tests/core) +;; TODO: remove me (deftest test-version-extraction (testing "Checking if it is possible to extract version from our changelog" (ok (equal (retrieve-system-version (asdf:find-system "40ants-asdf-system")) From d3d5149221ef76a126663f9aac2b02478e060699 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 01:31:14 +0300 Subject: [PATCH 09/20] Make matrix smaller to speed up tests. Full check will be only for SBCL. --- .github/workflows/ci.yml | 168 +++++++++++++++++++++++++++++++++++++-- src/ci.lisp | 55 ++++++++----- 2 files changed, 196 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e9a379..0ed3f19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,11 +83,167 @@ ] }, "run-tests": { - "runs-on": "ubuntu-latest", + "strategy": { + "fail-fast": false, + "matrix": { + "os": [ + "ubuntu-latest", + "macos-latest" + ], + "quicklisp": [ + "ultralisp", + "quicklisp" + ], + "lisp": [ + "sbcl", + "ccl-bin/1.12.1", + "abcl-bin", + "allegro", + "clasp", + "lispworks", + "mkcl", + "npt", + "ecl" + ], + "exclude": [ + { + "os": "ubuntu-latest", + "quicklisp": "ultralisp", + "lisp": "npt" + }, + { + "os": "ubuntu-latest", + "quicklisp": "quicklisp", + "lisp": "npt" + }, + { + "os": "ubuntu-latest", + "quicklisp": "quicklisp", + "lisp": "sbcl" + }, + { + "os": "macos-latest", + "quicklisp": "quicklisp", + "lisp": "sbcl" + }, + { + "os": "macos-latest", + "quicklisp": "ultralisp", + "lisp": "sbcl" + }, + { + "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" + } + ] + } + }, + "runs-on": "${{ matrix.os }}", "env": { - "OS": "ubuntu-latest", - "QUICKLISP_DIST": "ultralisp", - "LISP": "sbcl" + "OS": "${{ matrix.os }}", + "QUICKLISP_DIST": "${{ matrix.quicklisp }}", + "LISP": "${{ matrix.lisp }}" }, "steps": [ { @@ -111,7 +267,7 @@ "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-ultralisp-sbcl-${{ hashFiles('qlfile.lock', '*.asd') }}" + "key": "a-${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.quicklisp }}-${{ matrix.lisp }}-${{ hashFiles('qlfile.lock', '*.asd') }}" } }, { @@ -133,7 +289,7 @@ "uses": "40ants/run-tests@v2", "with": { "asdf-system": "40ants-asdf-system", - "coveralls-token": "${{ secrets.github_token }}" + "coveralls-token": "\n${{ matrix.lisp == 'sbcl-bin' &&\n matrix.os == 'ubuntu-latest' &&\n matrix.quicklisp == 'ultralisp' &&\n secrets.github_token }}" } } ] diff --git a/src/ci.lisp b/src/ci.lisp index 705188b..c7d48c1 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -10,6 +10,19 @@ #:build-docs)) (in-package #:40ants-asdf-system/ci) +(defvar *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" @@ -21,28 +34,28 @@ :check-imports t) (run-tests :os ("ubuntu-latest" - ;; "macos-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")) + "quicklisp") + :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))) From 3e6c89c5db00fd1a76e902a91d80798d472d924c Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 01:35:22 +0300 Subject: [PATCH 10/20] Move to sbcl-bin. --- .github/workflows/ci.yml | 17 +---------------- src/ci.lisp | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ed3f19..c12645d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ "quicklisp" ], "lisp": [ - "sbcl", + "sbcl-bin", "ccl-bin/1.12.1", "abcl-bin", "allegro", @@ -116,21 +116,6 @@ "quicklisp": "quicklisp", "lisp": "npt" }, - { - "os": "ubuntu-latest", - "quicklisp": "quicklisp", - "lisp": "sbcl" - }, - { - "os": "macos-latest", - "quicklisp": "quicklisp", - "lisp": "sbcl" - }, - { - "os": "macos-latest", - "quicklisp": "ultralisp", - "lisp": "sbcl" - }, { "os": "ubuntu-latest", "quicklisp": "quicklisp", diff --git a/src/ci.lisp b/src/ci.lisp index c7d48c1..1841a91 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -10,7 +10,7 @@ #:build-docs)) (in-package #:40ants-asdf-system/ci) -(defvar *lisp-implementations* +(defparameter *lisp-implementations* (list "sbcl-bin" "ccl-bin/1.12.1" "abcl-bin" From a22f646260b4c6dace3c14a0b35e5e02b522bc85 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 10:49:16 +0300 Subject: [PATCH 11/20] Testing move-to-fresh-msys --- .github/workflows/ci.yml | 182 ++------------------------------------- src/ci.lisp | 23 ++--- 2 files changed, 18 insertions(+), 187 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c12645d..d641438 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,39 +26,12 @@ "name": "Checkout Code", "uses": "actions/checkout@v3" }, - { - "name": "Grant All Perms to Make Cache Restoring Possible", - "run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin", - "shell": "bash" - }, - { - "name": "Get Current Month", - "id": "current-month", - "run": "echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT", - "shell": "bash" - }, - { - "name": "Cache Roswell Setup", - "id": "cache", - "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') }}" - } - }, - { - "name": "Restore Path To Cached Files", - "run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH", - "shell": "bash", - "if": "steps.cache.outputs.cache-hit == 'true'" - }, { "name": "Setup Common Lisp Environment", - "uses": "40ants/setup-lisp@v2", + "uses": "40ants/setup-lisp@move-to-fresh-msys", "with": { "asdf-system": "40ants-asdf-system-docs" - }, - "if": "steps.cache.outputs.cache-hit != 'true'" + } }, { "name": "Change dist to Ultralisp", @@ -94,17 +67,6 @@ "ultralisp", "quicklisp" ], - "lisp": [ - "sbcl-bin", - "ccl-bin/1.12.1", - "abcl-bin", - "allegro", - "clasp", - "lispworks", - "mkcl", - "npt", - "ecl" - ], "exclude": [ { "os": "ubuntu-latest", @@ -115,111 +77,6 @@ "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" } ] } @@ -228,46 +85,19 @@ "env": { "OS": "${{ matrix.os }}", "QUICKLISP_DIST": "${{ matrix.quicklisp }}", - "LISP": "${{ matrix.lisp }}" + "LISP": "sbcl-bin" }, "steps": [ { "name": "Checkout Code", "uses": "actions/checkout@v3" }, - { - "name": "Grant All Perms to Make Cache Restoring Possible", - "run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin", - "shell": "bash" - }, - { - "name": "Get Current Month", - "id": "current-month", - "run": "echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT", - "shell": "bash" - }, - { - "name": "Cache Roswell Setup", - "id": "cache", - "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') }}" - } - }, - { - "name": "Restore Path To Cached Files", - "run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH", - "shell": "bash", - "if": "steps.cache.outputs.cache-hit == 'true'" - }, { "name": "Setup Common Lisp Environment", - "uses": "40ants/setup-lisp@v2", + "uses": "40ants/setup-lisp@move-to-fresh-msys", "with": { "asdf-system": "40ants-asdf-system" - }, - "if": "steps.cache.outputs.cache-hit != 'true'" + } }, { "name": "Run Tests", @@ -280,4 +110,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/ci.lisp b/src/ci.lisp index 1841a91..0b4f414 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -12,23 +12,24 @@ (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") ) + ;; "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 + ;; :cache t :jobs ((linter :asdf-systems ("40ants-asdf-system-docs" "40ants-asdf-system-tests") :check-imports t) From c727ee8f1196016a7457393c1d6e564a8821c45c Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 10:51:54 +0300 Subject: [PATCH 12/20] Fixed workflow. --- .github/workflows/ci.yml | 33 ++++--------------------------- src/ci.lisp | 42 +++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d641438..1fc61b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,35 +56,10 @@ ] }, "run-tests": { - "strategy": { - "fail-fast": false, - "matrix": { - "os": [ - "ubuntu-latest", - "macos-latest" - ], - "quicklisp": [ - "ultralisp", - "quicklisp" - ], - "exclude": [ - { - "os": "ubuntu-latest", - "quicklisp": "ultralisp", - "lisp": "npt" - }, - { - "os": "ubuntu-latest", - "quicklisp": "quicklisp", - "lisp": "npt" - } - ] - } - }, - "runs-on": "${{ matrix.os }}", + "runs-on": "ubuntu-latest", "env": { - "OS": "${{ matrix.os }}", - "QUICKLISP_DIST": "${{ matrix.quicklisp }}", + "OS": "ubuntu-latest", + "QUICKLISP_DIST": "ultralisp", "LISP": "sbcl-bin" }, "steps": [ @@ -104,7 +79,7 @@ "uses": "40ants/run-tests@v2", "with": { "asdf-system": "40ants-asdf-system", - "coveralls-token": "\n${{ matrix.lisp == 'sbcl-bin' &&\n matrix.os == 'ubuntu-latest' &&\n matrix.quicklisp == 'ultralisp' &&\n secrets.github_token }}" + "coveralls-token": "${{ secrets.github_token }}" } } ] diff --git a/src/ci.lisp b/src/ci.lisp index 0b4f414..c2f49fa 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -35,28 +35,30 @@ :check-imports t) (run-tests :os ("ubuntu-latest" - "macos-latest") + ;; "macos-latest" + ) :quicklisp ("ultralisp" - "quicklisp") + ;; "quicklisp" + ) :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)))) + ;; :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))) From 8dff5820f7e5583b94879eb550766b305215fc56 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 11:52:09 +0300 Subject: [PATCH 13/20] Use new setup-lisp@v2. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fc61b8..de30d62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ }, { "name": "Setup Common Lisp Environment", - "uses": "40ants/setup-lisp@move-to-fresh-msys", + "uses": "40ants/setup-lisp@v2", "with": { "asdf-system": "40ants-asdf-system-docs" } @@ -69,7 +69,7 @@ }, { "name": "Setup Common Lisp Environment", - "uses": "40ants/setup-lisp@move-to-fresh-msys", + "uses": "40ants/setup-lisp@v2", "with": { "asdf-system": "40ants-asdf-system" } From 0443838476a476c4e04aefa60e04f097b99e030a Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 12:08:59 +0300 Subject: [PATCH 14/20] Use full matrix again. --- .github/workflows/ci.yml | 211 +++++++++++++++++++++++++++++++++++++-- src/ci.lisp | 65 ++++++------ 2 files changed, 234 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de30d62..c12645d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,12 +26,39 @@ "name": "Checkout Code", "uses": "actions/checkout@v3" }, + { + "name": "Grant All Perms to Make Cache Restoring Possible", + "run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin", + "shell": "bash" + }, + { + "name": "Get Current Month", + "id": "current-month", + "run": "echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT", + "shell": "bash" + }, + { + "name": "Cache Roswell Setup", + "id": "cache", + "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') }}" + } + }, + { + "name": "Restore Path To Cached Files", + "run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH", + "shell": "bash", + "if": "steps.cache.outputs.cache-hit == 'true'" + }, { "name": "Setup Common Lisp Environment", "uses": "40ants/setup-lisp@v2", "with": { "asdf-system": "40ants-asdf-system-docs" - } + }, + "if": "steps.cache.outputs.cache-hit != 'true'" }, { "name": "Change dist to Ultralisp", @@ -56,33 +83,201 @@ ] }, "run-tests": { - "runs-on": "ubuntu-latest", + "strategy": { + "fail-fast": false, + "matrix": { + "os": [ + "ubuntu-latest", + "macos-latest" + ], + "quicklisp": [ + "ultralisp", + "quicklisp" + ], + "lisp": [ + "sbcl-bin", + "ccl-bin/1.12.1", + "abcl-bin", + "allegro", + "clasp", + "lispworks", + "mkcl", + "npt", + "ecl" + ], + "exclude": [ + { + "os": "ubuntu-latest", + "quicklisp": "ultralisp", + "lisp": "npt" + }, + { + "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" + } + ] + } + }, + "runs-on": "${{ matrix.os }}", "env": { - "OS": "ubuntu-latest", - "QUICKLISP_DIST": "ultralisp", - "LISP": "sbcl-bin" + "OS": "${{ matrix.os }}", + "QUICKLISP_DIST": "${{ matrix.quicklisp }}", + "LISP": "${{ matrix.lisp }}" }, "steps": [ { "name": "Checkout Code", "uses": "actions/checkout@v3" }, + { + "name": "Grant All Perms to Make Cache Restoring Possible", + "run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin", + "shell": "bash" + }, + { + "name": "Get Current Month", + "id": "current-month", + "run": "echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT", + "shell": "bash" + }, + { + "name": "Cache Roswell Setup", + "id": "cache", + "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') }}" + } + }, + { + "name": "Restore Path To Cached Files", + "run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH", + "shell": "bash", + "if": "steps.cache.outputs.cache-hit == 'true'" + }, { "name": "Setup Common Lisp Environment", "uses": "40ants/setup-lisp@v2", "with": { "asdf-system": "40ants-asdf-system" - } + }, + "if": "steps.cache.outputs.cache-hit != 'true'" }, { "name": "Run Tests", "uses": "40ants/run-tests@v2", "with": { "asdf-system": "40ants-asdf-system", - "coveralls-token": "${{ secrets.github_token }}" + "coveralls-token": "\n${{ matrix.lisp == 'sbcl-bin' &&\n matrix.os == 'ubuntu-latest' &&\n matrix.quicklisp == 'ultralisp' &&\n secrets.github_token }}" } } ] } } -} +} \ No newline at end of file diff --git a/src/ci.lisp b/src/ci.lisp index c2f49fa..1841a91 100644 --- a/src/ci.lisp +++ b/src/ci.lisp @@ -12,53 +12,50 @@ (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" - ) ) + "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 + :cache t :jobs ((linter :asdf-systems ("40ants-asdf-system-docs" "40ants-asdf-system-tests") :check-imports t) (run-tests :os ("ubuntu-latest" - ;; "macos-latest" - ) + "macos-latest") :quicklisp ("ultralisp" - ;; "quicklisp" - ) + "quicklisp") :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)))) + :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))) From 9ed35b5e95dce02c605e70c0deb0e6dcf58440fb Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 15:56:42 +0300 Subject: [PATCH 15/20] Added support for long-description. --- 40ants-asdf-system.asd | 1 + src/package.lisp | 4 +++- src/readme.lisp | 11 +++++++++++ src/system.lisp | 37 ++++++++++++++++++++++++++++--------- src/version.lisp | 24 +++++++----------------- 5 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 src/readme.lisp diff --git a/40ants-asdf-system.asd b/40ants-asdf-system.asd index 0ca96ab..abafa3d 100644 --- a/40ants-asdf-system.asd +++ b/40ants-asdf-system.asd @@ -11,5 +11,6 @@ :components ((:module "src" :components ((:file "package") (:file "version" :depends-on ("package")) + (:file "readme" :depends-on ("package")) (:file "system" :depends-on ("version"))))) :in-order-to ((test-op (test-op "40ants-asdf-system-tests")))) diff --git a/src/package.lisp b/src/package.lisp index 3cc5b0d..71d32bd 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1,4 +1,6 @@ (uiop:define-package #:40ants-asdf-system (:use #:cl) - (:nicknames #:40ants-asdf-system/system)) + (:nicknames #:40ants-asdf-system/system) + (:export #:path-to-changelog + #:path-to-readme)) diff --git a/src/readme.lisp b/src/readme.lisp new file mode 100644 index 0000000..80e2b94 --- /dev/null +++ b/src/readme.lisp @@ -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)))) diff --git a/src/system.lisp b/src/system.lisp index 03e6412..396e400 100644 --- a/src/system.lisp +++ b/src/system.lisp @@ -2,16 +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) - (setf (slot-value system 'version-from-changelog) - (retrieve-system-version system)))) +(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)))))) diff --git a/src/version.lisp b/src/version.lisp index 03e6f85..5cf041d 100644 --- a/src/version.lisp +++ b/src/version.lisp @@ -24,20 +24,10 @@ (defun retrieve-system-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 - (return-from retrieve-system-version version)))))) + (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)))) From 156a51aad58e651954899df60b4bd7e9651758be Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 16:38:19 +0300 Subject: [PATCH 16/20] Added export of 40ants-asdf-system from 40ants-asdf-system package. --- src/package.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/package.lisp b/src/package.lisp index 71d32bd..662290e 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1,6 +1,9 @@ (uiop:define-package #:40ants-asdf-system (:use #:cl) (:nicknames #:40ants-asdf-system/system) - (:export #:path-to-changelog + (:import-from #:asdf/interface + #:40ants-asdf-system) + (:export #:40ants-asdf-system + #:path-to-changelog #:path-to-readme)) From 541ecf48af931a4f17731bf276dd9a4dc9a4240b Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 17:10:26 +0300 Subject: [PATCH 17/20] Added test system. --- t/core.lisp | 7 ++++--- t/test-40ants-system.asd | 4 ++++ t/test-changelog.lisp | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 t/test-40ants-system.asd create mode 100644 t/test-changelog.lisp diff --git a/t/core.lisp b/t/core.lisp index 5c2da82..59e8193 100644 --- a/t/core.lisp +++ b/t/core.lisp @@ -9,8 +9,9 @@ (in-package #:40ants-asdf-system-tests/core) -;; TODO: remove me (deftest test-version-extraction (testing "Checking if it is possible to extract version from our changelog" - (ok (equal (retrieve-system-version (asdf:find-system "40ants-asdf-system")) - "0.1.0")))) + (asdf:load-asd (asdf:system-relative-pathname (asdf:registered-system "40ants-asdf-system") + (uiop:parse-unix-namestring "t/test-40ants-system.asd"))) + (ok (equal (retrieve-system-version (asdf:find-system "test-40ants-system")) + "0.2.0")))) diff --git a/t/test-40ants-system.asd b/t/test-40ants-system.asd new file mode 100644 index 0000000..d10d1bd --- /dev/null +++ b/t/test-40ants-system.asd @@ -0,0 +1,4 @@ +(defsystem "test-40ants-system" + :class :40ants-asdf-system + :defsystem-depends-on ("40ants-asdf-system") + :path-to-changelog "test-changelog.lisp" ) diff --git a/t/test-changelog.lisp b/t/test-changelog.lisp new file mode 100644 index 0000000..f4663f4 --- /dev/null +++ b/t/test-changelog.lisp @@ -0,0 +1,12 @@ +(uiop:define-package #:test-40ants-system/changelog + (:use #:cl) + (:import-from #:40ants-doc/changelog + #:defchangelog)) +(in-package #:test-40ants-system/changelog) + + +(defchangelog () + (0.2.0 2022-11-07 + "* Second version") + (0.1.0 2022-08-07 + "* Initial version.")) From 519a7b45e1f030f49076af0f3c83cccf0516282d Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 17:38:36 +0300 Subject: [PATCH 18/20] No deps for Qlot update. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c12645d..8dcc818 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ }, { "name": "Update Qlot", - "run": "qlot update || qlot update", + "run": "qlot update --no-deps", "shell": "bash" }, { @@ -280,4 +280,4 @@ ] } } -} \ No newline at end of file +} From c067aa2dc9158c61571948089991c6cd102a67c4 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 18:22:13 +0300 Subject: [PATCH 19/20] Use linter from github. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dcc818..7115cd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ }, { "name": "Install SBLint wrapper", - "run": "qlot exec ros install 40ants-linter", + "run": "qlot exec ros install 40ants/40ants-linter", "shell": "bash" }, { From 2acd587a7d19621ec1da044dd0f40a9f40121407 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 10 Nov 2022 18:32:00 +0300 Subject: [PATCH 20/20] Using fresh linter. --- .github/workflows/ci.yml | 2 +- qlfile | 2 +- qlfile.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7115cd9..8dcc818 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ }, { "name": "Install SBLint wrapper", - "run": "qlot exec ros install 40ants/40ants-linter", + "run": "qlot exec ros install 40ants-linter", "shell": "bash" }, { diff --git a/qlfile b/qlfile index 99bebf8..b91f000 100644 --- a/qlfile +++ b/qlfile @@ -1 +1 @@ -dist ultralisp http://dist.ultralisp.org/ +dist ultralisp http://dist.ultralisp.org diff --git a/qlfile.lock b/qlfile.lock index b9301ab..aac9c68 100644 --- a/qlfile.lock +++ b/qlfile.lock @@ -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"))