From 56f59c19d09b019fa06f750c46b89fcde8e42ba7 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Tue, 27 Feb 2024 04:41:10 +0000 Subject: [PATCH] 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. --- src/changelog.lisp | 9 +++++++++ src/core.lisp | 16 +++++++-------- src/jobs/autotag.lisp | 2 +- src/jobs/lisp-job.lisp | 44 +++++------------------------------------- 4 files changed, 23 insertions(+), 48 deletions(-) diff --git a/src/changelog.lisp b/src/changelog.lisp index 59e476b..807c16f 100644 --- a/src/changelog.lisp +++ b/src/changelog.lisp @@ -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 diff --git a/src/core.lisp b/src/core.lisp index b1063c9..6fedc82 100644 --- a/src/core.lisp +++ b/src/core.lisp @@ -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\" } @@ -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\" } @@ -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\": \"\" @@ -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\", @@ -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\": \"\" diff --git a/src/jobs/autotag.lisp b/src/jobs/autotag.lisp index ee6f857..9e4a576 100644 --- a/src/jobs/autotag.lisp +++ b/src/jobs/autotag.lisp @@ -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" diff --git a/src/jobs/lisp-job.lisp b/src/jobs/lisp-job.lisp index fdf4d57..526f2dc 100644 --- a/src/jobs/lisp-job.lisp +++ b/src/jobs/lisp-job.lisp @@ -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)))