Skip to content

Commit

Permalink
All jobs now use setup-lisp@v4 where internal caching was implemented.
Browse files Browse the repository at this point in the history
Also all jobs were switched to from `actions/checkout@v3` to `actions/checkout@v4` action.
  • Loading branch information
svetlyak40wt committed Feb 27, 2024
1 parent f1c2487 commit 56f59c1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 48 deletions.
9 changes: 9 additions & 0 deletions src/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
"GITHUB_TOKEN"
"OSX")
:external-docs ("https://40ants.com/40ants-asdf-system/"))
(0.14.0 2024-02-25
"
Changed
=======
All jobs now use setup-lisp@v4 where internal caching was implemented.
Also all jobs were switched to from `actions/checkout@v3` to `actions/checkout@v4` action.
")
(0.13.0 2023-12-14
"
Changed
Expand Down
16 changes: 8 additions & 8 deletions src/core.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ it will generate `.github/workflows/linter.yml` with following content:
\"steps\": [
{
\"name\": \"Checkout Code\",
\"uses\": \"actions/checkout@v3\"
\"uses\": \"actions/checkout@v4\"
},
{
\"name\": \"Setup Common Lisp Environment\",
\"uses\": \"40ants/setup-lisp@v3\",
\"uses\": \"40ants/setup-lisp@v4\",
\"with\": {
\"asdf-system\": \"example\"
}
Expand Down Expand Up @@ -285,11 +285,11 @@ It will generate `.github/workflows/ci.yml` with following content:
\"steps\": [
{
\"name\": \"Checkout Code\",
\"uses\": \"actions/checkout@v3\"
\"uses\": \"actions/checkout@v4\"
},
{
\"name\": \"Setup Common Lisp Environment\",
\"uses\": \"40ants/setup-lisp@v3\",
\"uses\": \"40ants/setup-lisp@v4\",
\"with\": {
\"asdf-system\": \"example\"
}
Expand Down Expand Up @@ -435,11 +435,11 @@ It will generate `.github/workflows/docs.yml` with following content:
\"steps\": [
{
\"name\": \"Checkout Code\",
\"uses\": \"actions/checkout@v3\"
\"uses\": \"actions/checkout@v4\"
},
{
\"name\": \"Setup Common Lisp Environment\",
\"uses\": \"40ants/setup-lisp@v3\",
\"uses\": \"40ants/setup-lisp@v4\",
\"with\": {
\"asdf-system\": \"example\",
\"qlfile-template\": \"\"
Expand Down Expand Up @@ -484,7 +484,7 @@ Here is the diff of the generated workflow file. It shows steps, added automatic
modified .github/workflows/docs.yml
@@ -20,13 +20,40 @@
\"name\": \"Checkout Code\",
\"uses\": \"actions/checkout@v3\"
\"uses\": \"actions/checkout@v4\"
},
+ {
+ \"name\": \"Grant All Perms to Make Cache Restoring Possible\",
Expand Down Expand Up @@ -514,7 +514,7 @@ modified .github/workflows/docs.yml
+ },
{
\"name\": \"Setup Common Lisp Environment\",
\"uses\": \"40ants/setup-lisp@v3\",
\"uses\": \"40ants/setup-lisp@v4\",
\"with\": {
\"asdf-system\": \"40ants-ci\",
\"qlfile-template\": \"\"
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/autotag.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(defmethod 40ants-ci/jobs/job:steps ((job autotag))
(append (list
(action "Checkout Code"
"actions/checkout@v3"))
"actions/checkout@v4"))
(list
(action "Create release tag"
"butlerlogic/action-autotag@8bc1ad456dcdee34e8c6ffbce991cc31793578c2"
Expand Down
44 changes: 5 additions & 39 deletions src/jobs/lisp-job.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -127,54 +127,20 @@
(write-string "${{ hashFiles('qlfile.lock', '*.asd') }}" s))))


(defgeneric make-cache-steps (job)
(:method ((job lisp-job))
(when 40ants-ci/vars:*use-cache*
(let ((paths-to-cache
(list "qlfile"
"qlfile.lock"
"~/.cache/common-lisp/"
"~/.roswell"
"/usr/local/etc/roswell"
"/usr/local/bin/ros"
;; On OSX Roswell is installed
;; using Homebrew and /usr/local/bin/ros
;; is a symlink into a Cellar directory:
"/usr/local/Cellar/roswell"
".qlot")))
(list (sh "Grant All Perms to Make Cache Restoring Possible"
"sudo mkdir -p /usr/local/etc/roswell
sudo chown \"${USER}\" /usr/local/etc/roswell
# Here the ros binary will be restored:
sudo chown \"${USER}\" /usr/local/bin")
(sh "Get Current Month"
"echo \"value=$(date -u \"+%Y-%m\")\" >> $GITHUB_OUTPUT"
:id "current-month")
(action "Cache Roswell Setup"
"actions/cache@v3"
:id "cache"
:path (format nil "~{~A~^~%~}" paths-to-cache)
:key (make-cache-key job))
(sh "Restore Path To Cached Files"
"echo $HOME/.roswell/bin >> $GITHUB_PATH
echo .qlot/bin >> $GITHUB_PATH"
:if "steps.cache.outputs.cache-hit == 'true'"))))))


(defmethod 40ants-ci/jobs/job:steps ((job lisp-job))
(append (list
(action "Checkout Code"
"actions/checkout@v3"))
(make-cache-steps job)
"actions/checkout@v4"))
(list
(action "Setup Common Lisp Environment"
"40ants/setup-lisp@v3"
"40ants/setup-lisp@v4"
:asdf-system (asdf-system job)
:asdf-version (asdf-version job)
:roswell-version (roswell-version job)
:qlot-version (qlot-version job)
:qlfile-template (when (qlfile job)
(dedent (qlfile job)))
:if (when *use-cache*
"steps.cache.outputs.cache-hit != 'true'")))
:cache (if *use-cache*
"true"
"false")))
(call-next-method)))

0 comments on commit 56f59c1

Please sign in to comment.