From b803008420948c4d5492db946be91949e7ee1d7b Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:09:23 +0300 Subject: [PATCH 01/28] Added a cache step. --- .github/workflows/docs.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 048b7de..65066d6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'master' + - 'test-cache' schedule: - cron: '0 10 * * 1' @@ -19,7 +20,15 @@ jobs: steps: - uses: actions/checkout@v1 - - uses: 40ants/setup-lisp@v1 + - name: Cache Roswell Setup + uses: actions/cache@v2 + env: + cache-name: cache-roswell + with: + path: ~/.roswell + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }} + with: + - uses: 40ants/setup-lisp@test-cache - uses: 40ants/build-docs@v1 with: asdf-system: docs From 73773846852c9a604da639de6e4bb680bfb88a72 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:13:04 +0300 Subject: [PATCH 02/28] Updated dependencies. --- qlfile.lock | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qlfile.lock b/qlfile.lock index 89b0f94..693e173 100644 --- a/qlfile.lock +++ b/qlfile.lock @@ -5,8 +5,12 @@ ("ultralisp" . (:class qlot/source/dist:source-dist :initargs (:distribution "http://dist.ultralisp.org" :%version :latest) - :version "20210215183000")) + :version "20210224171000")) ("mgl-pax" . (:class qlot/source/github:source-github :initargs (:repos "svetlyak40wt/mgl-pax" :ref nil :branch "mgl-pax-minimal" :tag nil) - :version "github-dc8a4585d7b9fe7b4c83a4bc2f338eab")) + :version "github-6c4eecc1be34466756e6096d1c5071f5")) +("sly" . + (:class qlot/source/github:source-github + :initargs (:repos "svetlyak40wt/sly" :ref nil :branch "patches" :tag nil) + :version "github-62eaa8112b926b328a9838e7d5b21c15")) From e4b1117f61c8f937ce3c20c45b93eedfa64c6332 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:16:53 +0300 Subject: [PATCH 03/28] Fixed YAML. --- .github/workflows/docs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 65066d6..65d5630 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,8 +26,7 @@ jobs: cache-name: cache-roswell with: path: ~/.roswell - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }} - with: + key: "${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" - uses: 40ants/setup-lisp@test-cache - uses: 40ants/build-docs@v1 with: From 78c262b5a9d282d1ee1201c7d9a7d092b58724cd Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:22:58 +0300 Subject: [PATCH 04/28] Use multiple paths to save all deps into the cache. --- .github/workflows/docs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 65d5630..b59596a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,8 +25,11 @@ jobs: env: cache-name: cache-roswell with: - path: ~/.roswell - key: "${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" + path: | + ~/.roswell + /usr/local/etc/roswell + .qlot + key: "${{ runner.os }}-build1-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" - uses: 40ants/setup-lisp@test-cache - uses: 40ants/build-docs@v1 with: From a47eff4562c95a5e9684ef0b0a0dd7e66d0d4e09 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:29:46 +0300 Subject: [PATCH 05/28] Rebuild. --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b59596a..c5f0e69 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -35,4 +35,3 @@ jobs: with: asdf-system: docs # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }} - From df5bfc199c19694a53a8a9cd4fa7e876a90aadd1 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:38:11 +0300 Subject: [PATCH 06/28] Fix cache restoration. --- .github/workflows/docs.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c5f0e69..ec4ec96 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,11 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Grant All Perms on /usr/local/etc/roswell + # This makes cache restoration possible + run: sudo mkdir /usr/local/etc/roswell && sudo chmod a+rwx /usr/local/etc/roswell - name: Cache Roswell Setup + id: cache uses: actions/cache@v2 env: cache-name: cache-roswell @@ -30,7 +34,8 @@ jobs: /usr/local/etc/roswell .qlot key: "${{ runner.os }}-build1-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" - - uses: 40ants/setup-lisp@test-cache + # - uses: 40ants/setup-lisp@test-cache + # if: steps.cache.outputs.cache-hit != 'true' - uses: 40ants/build-docs@v1 with: asdf-system: docs From 81e5b311026108bbbbd831925b885f6acacaafa0 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:40:38 +0300 Subject: [PATCH 07/28] Added -R. --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ec4ec96..00955b0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v1 - name: Grant All Perms on /usr/local/etc/roswell # This makes cache restoration possible - run: sudo mkdir /usr/local/etc/roswell && sudo chmod a+rwx /usr/local/etc/roswell + run: sudo mkdir /usr/local/etc/roswell && sudo chmod -R a+rwx /usr/local/etc/roswell - name: Cache Roswell Setup id: cache uses: actions/cache@v2 @@ -34,7 +34,7 @@ jobs: /usr/local/etc/roswell .qlot key: "${{ runner.os }}-build1-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" - # - uses: 40ants/setup-lisp@test-cache + #- uses: 40ants/setup-lisp@test-cache # if: steps.cache.outputs.cache-hit != 'true' - uses: 40ants/build-docs@v1 with: From 74295df3e62bbb3637b57bdc5d4776a0785213d4 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:43:53 +0300 Subject: [PATCH 08/28] Who am I. --- .github/workflows/docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 00955b0..e3f3af4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -23,6 +23,8 @@ jobs: - name: Grant All Perms on /usr/local/etc/roswell # This makes cache restoration possible run: sudo mkdir /usr/local/etc/roswell && sudo chmod -R a+rwx /usr/local/etc/roswell + - name: Who am I + run: whoami - name: Cache Roswell Setup id: cache uses: actions/cache@v2 From 0f01b6839da1eec3d8c06f2dc88e38ebe0e50123 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:44:57 +0300 Subject: [PATCH 09/28] More debug info. --- .github/workflows/docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e3f3af4..db0b240 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,6 +25,10 @@ jobs: run: sudo mkdir /usr/local/etc/roswell && sudo chmod -R a+rwx /usr/local/etc/roswell - name: Who am I run: whoami + - name: Who am under SUDO + run: sudo echo `whoami` + - name: USSER under SUDO + run: sudo echo "${USER}" - name: Cache Roswell Setup id: cache uses: actions/cache@v2 From 1e19b26582d128360321765d83c8b9f2f9c6e4ed Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:46:39 +0300 Subject: [PATCH 10/28] Use chown instead of chmod. --- .github/workflows/docs.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index db0b240..a3f029c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,13 +22,7 @@ jobs: - uses: actions/checkout@v1 - name: Grant All Perms on /usr/local/etc/roswell # This makes cache restoration possible - run: sudo mkdir /usr/local/etc/roswell && sudo chmod -R a+rwx /usr/local/etc/roswell - - name: Who am I - run: whoami - - name: Who am under SUDO - run: sudo echo `whoami` - - name: USSER under SUDO - run: sudo echo "${USER}" + run: sudo mkdir -p /usr/local/etc/roswell && sudo chown "${USER}" /usr/local/etc/roswell - name: Cache Roswell Setup id: cache uses: actions/cache@v2 From dc45e446061439d0581c8c0b7a838a76883430a8 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:48:22 +0300 Subject: [PATCH 11/28] Checking dirs. --- .github/workflows/docs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a3f029c..d077e98 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,6 +34,12 @@ jobs: /usr/local/etc/roswell .qlot key: "${{ runner.os }}-build1-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" + - name: Check dirs + run: | + set -x + ls ~/.roswell + ls /usr/local/etc/roswell + ls .qlot #- uses: 40ants/setup-lisp@test-cache # if: steps.cache.outputs.cache-hit != 'true' - uses: 40ants/build-docs@v1 From d316acd58558c758866fd1188577fd43d412130c Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:52:17 +0300 Subject: [PATCH 12/28] Restore path to cache results. --- .github/workflows/docs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d077e98..7d2df94 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -40,6 +40,11 @@ jobs: ls ~/.roswell ls /usr/local/etc/roswell ls .qlot + - name: Restore Path + run: | + echo $HOME/.roswell/bin >> $GITHUB_PATH + echo .qlot/bin >> $GITHUB_PATH + if: steps.cache.outputs.cache-hit == 'true' #- uses: 40ants/setup-lisp@test-cache # if: steps.cache.outputs.cache-hit != 'true' - uses: 40ants/build-docs@v1 From 299f8bc758d857533348e15ceb87081c8417f8f0 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:52:17 +0300 Subject: [PATCH 13/28] Restore path to cache results. --- .github/workflows/docs.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d077e98..de9f2de 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -40,9 +40,21 @@ jobs: ls ~/.roswell ls /usr/local/etc/roswell ls .qlot - #- uses: 40ants/setup-lisp@test-cache - # if: steps.cache.outputs.cache-hit != 'true' - - uses: 40ants/build-docs@v1 - with: - asdf-system: docs - # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }} + - name: Restore Path + run: | + echo $HOME/.roswell/bin >> $GITHUB_PATH + echo .qlot/bin >> $GITHUB_PATH + if: steps.cache.outputs.cache-hit == 'true' + - uses: 40ants/setup-lisp@test-cache +# if: steps.cache.outputs.cache-hit != 'true' + - name: Check dirs again + run: | + set -x + ls ~/.roswell + ls /usr/local/etc/roswell + ls .qlot + + # - uses: 40ants/build-docs@v1 + # with: + # asdf-system: docs + # # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }} From ab400fcb133a2c74c1b6088cbb2f3f85e22fd40b Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:54:41 +0300 Subject: [PATCH 14/28] More testing. --- .github/workflows/docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index de9f2de..d4dc116 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -53,7 +53,8 @@ jobs: ls ~/.roswell ls /usr/local/etc/roswell ls .qlot - + + # - uses: 40ants/build-docs@v1 # with: # asdf-system: docs From a277b6aaca7c3b66f48b082849e0d91ae634ca31 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Wed, 24 Feb 2021 23:59:40 +0300 Subject: [PATCH 15/28] Checki which ros. --- .github/workflows/docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d4dc116..1186eaa 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,6 +29,7 @@ jobs: env: cache-name: cache-roswell with: + # ~/.cache/common-lisp/ path: | ~/.roswell /usr/local/etc/roswell @@ -50,6 +51,7 @@ jobs: - name: Check dirs again run: | set -x + which ros ls ~/.roswell ls /usr/local/etc/roswell ls .qlot From c6507765d6dad8ba62d528abbf1ea91336234732 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:02:15 +0300 Subject: [PATCH 16/28] More debug info. --- .github/workflows/docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1186eaa..724dbc4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -52,6 +52,8 @@ jobs: run: | set -x which ros + ls /usr/local/bin + tree /usr/local ls ~/.roswell ls /usr/local/etc/roswell ls .qlot From 971ebac7e1c38be4ddb9454df545e3d320f04a54 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:02:52 +0300 Subject: [PATCH 17/28] And which qlot. --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 724dbc4..1d5342b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -52,6 +52,7 @@ jobs: run: | set -x which ros + which qlot ls /usr/local/bin tree /usr/local ls ~/.roswell From aac5b08ab6bbb56c11825a4c4a93ec6a4c237810 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:07:54 +0300 Subject: [PATCH 18/28] Caching ros binary. --- .github/workflows/docs.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1d5342b..371032d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,16 +29,19 @@ jobs: env: cache-name: cache-roswell with: - # ~/.cache/common-lisp/ path: | + /usr/local/bin/ros + ~/.cache/common-lisp/ ~/.roswell /usr/local/etc/roswell .qlot - key: "${{ runner.os }}-build1-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" + key: "${{ runner.os }}-build2-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" - name: Check dirs run: | set -x - ls ~/.roswell + which ros + which qlot + tree ~/.roswell ls /usr/local/etc/roswell ls .qlot - name: Restore Path @@ -53,9 +56,7 @@ jobs: set -x which ros which qlot - ls /usr/local/bin - tree /usr/local - ls ~/.roswell + tree ~/.roswell ls /usr/local/etc/roswell ls .qlot From 342110d24fd6e8c803a13e12f11922e4f3cd2954 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:15:43 +0300 Subject: [PATCH 19/28] Check cache only if restored. --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 371032d..94a4f83 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,6 +44,7 @@ jobs: tree ~/.roswell ls /usr/local/etc/roswell ls .qlot + if: steps.cache.outputs.cache-hit == 'true' - name: Restore Path run: | echo $HOME/.roswell/bin >> $GITHUB_PATH From 083aa5ec730676b797612c3c95f6e94f75875658 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:22:04 +0300 Subject: [PATCH 20/28] Added example how to get month. --- .github/workflows/docs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 94a4f83..c5b0bd7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -23,6 +23,11 @@ jobs: - name: Grant All Perms on /usr/local/etc/roswell # This makes cache restoration possible run: sudo mkdir -p /usr/local/etc/roswell && sudo chown "${USER}" /usr/local/etc/roswell + # - name: Get Current Month + # id: current-month + # run: | + # echo "::set-output name=value::$(date -u "+%Y-%m")" + # # use it as ${{ steps.current-month.outputs.value }} - name: Cache Roswell Setup id: cache uses: actions/cache@v2 From d529a19ef47381629478d5b1627c00470e9fe783 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:23:54 +0300 Subject: [PATCH 21/28] Chown on whole /usr/local --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c5b0bd7..7e3357e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v1 - name: Grant All Perms on /usr/local/etc/roswell # This makes cache restoration possible - run: sudo mkdir -p /usr/local/etc/roswell && sudo chown "${USER}" /usr/local/etc/roswell + run: sudo chown -R "${USER}" /usr/local # - name: Get Current Month # id: current-month # run: | From 403fe83da28f56a3b71fa11469b60a47df31fdec Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:30:11 +0300 Subject: [PATCH 22/28] Returned selective chown. --- .github/workflows/docs.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7e3357e..80378a9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,11 @@ jobs: - uses: actions/checkout@v1 - name: Grant All Perms on /usr/local/etc/roswell # This makes cache restoration possible - run: sudo chown -R "${USER}" /usr/local + run: | + 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 # - name: Get Current Month # id: current-month # run: | @@ -41,6 +45,11 @@ jobs: /usr/local/etc/roswell .qlot key: "${{ runner.os }}-build2-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" + - name: Restore Path + run: | + echo $HOME/.roswell/bin >> $GITHUB_PATH + echo .qlot/bin >> $GITHUB_PATH + if: steps.cache.outputs.cache-hit == 'true' - name: Check dirs run: | set -x @@ -50,11 +59,6 @@ jobs: ls /usr/local/etc/roswell ls .qlot if: steps.cache.outputs.cache-hit == 'true' - - name: Restore Path - run: | - echo $HOME/.roswell/bin >> $GITHUB_PATH - echo .qlot/bin >> $GITHUB_PATH - if: steps.cache.outputs.cache-hit == 'true' - uses: 40ants/setup-lisp@test-cache # if: steps.cache.outputs.cache-hit != 'true' - name: Check dirs again From 2ac6a3bf1bd1f9ab4cbfe56653a2cff5112b0670 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:33:26 +0300 Subject: [PATCH 23/28] Setup lisp only if there is no cache. --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 80378a9..8818a6f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -60,7 +60,7 @@ jobs: ls .qlot if: steps.cache.outputs.cache-hit == 'true' - uses: 40ants/setup-lisp@test-cache -# if: steps.cache.outputs.cache-hit != 'true' + if: steps.cache.outputs.cache-hit != 'true' - name: Check dirs again run: | set -x From 27ca8cb8a77645abe0bdff8f30135f7458c25515 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:38:22 +0300 Subject: [PATCH 24/28] Returned docs build. --- .github/workflows/docs.yml | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8818a6f..08ee3f6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -45,33 +45,14 @@ jobs: /usr/local/etc/roswell .qlot key: "${{ runner.os }}-build2-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" - - name: Restore Path + - name: Restore Path To Cached Files run: | echo $HOME/.roswell/bin >> $GITHUB_PATH echo .qlot/bin >> $GITHUB_PATH if: steps.cache.outputs.cache-hit == 'true' - - name: Check dirs - run: | - set -x - which ros - which qlot - tree ~/.roswell - ls /usr/local/etc/roswell - ls .qlot - if: steps.cache.outputs.cache-hit == 'true' - uses: 40ants/setup-lisp@test-cache if: steps.cache.outputs.cache-hit != 'true' - - name: Check dirs again - run: | - set -x - which ros - which qlot - tree ~/.roswell - ls /usr/local/etc/roswell - ls .qlot - - - # - uses: 40ants/build-docs@v1 - # with: - # asdf-system: docs - # # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }} + - uses: 40ants/build-docs@v1 + with: + asdf-system: docs + # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }} From 1f2c40fa44267a862313eddc5050f03705c82987 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:39:52 +0300 Subject: [PATCH 25/28] Use month in the cache key. --- .github/workflows/docs.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 08ee3f6..191c8a5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,11 +27,10 @@ jobs: sudo chown "${USER}" /usr/local/etc/roswell # Here the ros binary will be restored: sudo chown "${USER}" /usr/local/bin - # - name: Get Current Month - # id: current-month - # run: | - # echo "::set-output name=value::$(date -u "+%Y-%m")" - # # use it as ${{ steps.current-month.outputs.value }} + - name: Get Current Month + id: current-month + run: | + echo "::set-output name=value::$(date -u "+%Y-%m")" - name: Cache Roswell Setup id: cache uses: actions/cache@v2 @@ -44,7 +43,7 @@ jobs: ~/.roswell /usr/local/etc/roswell .qlot - key: "${{ runner.os }}-build2-${{ env.cache-name }}-${{ hashFiles('qlfile.lock') }}" + key: "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('qlfile.lock') }}" - name: Restore Path To Cached Files run: | echo $HOME/.roswell/bin >> $GITHUB_PATH From 09b7780ebd1cbbe34890b756ce2f2cec5530ab93 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 00:47:59 +0300 Subject: [PATCH 26/28] Try use fixed build-docs. --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 191c8a5..8582c02 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -51,7 +51,7 @@ jobs: if: steps.cache.outputs.cache-hit == 'true' - uses: 40ants/setup-lisp@test-cache if: steps.cache.outputs.cache-hit != 'true' - - uses: 40ants/build-docs@v1 + - uses: 40ants/build-docs@v2-alpha with: asdf-system: docs # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }} From 5287719976f78a1c17f52439590efbbfb2ebb886 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 11:32:03 +0300 Subject: [PATCH 27/28] Added documentation on how to use caching propetly. --- .github/workflows/docs.yml | 4 +-- docs.lisp | 62 +++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8582c02..fb4e6b0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,6 @@ on: branches: - 'main' - 'master' - - 'test-cache' schedule: - cron: '0 10 * * 1' @@ -20,8 +19,7 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Grant All Perms on /usr/local/etc/roswell - # This makes cache restoration possible + - name: Grant All Perms to Make Cache Restoring Possible run: | sudo mkdir -p /usr/local/etc/roswell sudo chown "${USER}" /usr/local/etc/roswell diff --git a/docs.lisp b/docs.lisp index 020ed45..5f634ff 100644 --- a/docs.lisp +++ b/docs.lisp @@ -19,6 +19,7 @@ and [Qlot](https://github.com/fukamachi/qlot) inside the Github CI. (@features section) (@typical-usage section) (@ql-file section) + (@caching section) (@roadmap section)) @@ -154,9 +155,68 @@ and [Jinja2](https://jinja.palletsprojects.com/). ") +(defsection @caching (:title "Caching") + " +Usually installing Roswell, a lisp implementation and dependencies +take from 2 to 10 minutes. Multiply this to the number of +matrix combinations and you'll get signifficant time. + +To speed up build, you can use caching using a standad GitHub action `actions/cache@v2`. + +To make caching work, add such sections into your workflow file: + +```yaml +- name: Grant All Perms to Make Cache Restoring Possible + run: | + 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 +- name: Get Current Month + id: current-month + run: | + echo "::set-output name=value::$(date -u "+%Y-%m")" +- name: Cache Roswell Setup + id: cache + uses: actions/cache@v2 + env: + cache-name: cache-roswell + with: + path: | + /usr/local/bin/ros + ~/.cache/common-lisp/ + ~/.roswell + /usr/local/etc/roswell + .qlot + key: "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('qlfile.lock') }}" +- name: Restore Path To Cached Files + run: | + echo $HOME/.roswell/bin >> $GITHUB_PATH + echo .qlot/bin >> $GITHUB_PATH + if: steps.cache.outputs.cache-hit == 'true' +- uses: 40ants/setup-lisp@test-cache + if: steps.cache.outputs.cache-hit != 'true' +``` + +There are two important lines here. + +- The last line `if: steps.cache.outputs.cache-hit != 'true'` skips + running lisp installation, it it was take from the cache. +- The `key` value: + + ``` + key: "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('qlfile.lock') }}" + ``` + + It controls when your cache will be matched. If you are using `matrix`, put all it's components + into the key. + + I also added a current month there, to make sure cache will be renewed at least monthly. + This way a new Roswell, Qlot and ASDF will be used in a build. +") + (defsection @roadmap (:title "Roadmap") " -- Make action use caching to speedup dependencies installation. - Support [CLPM](https://gitlab.common-lisp.net/clpm/clpm). - Vendor all dependencies, to make action more reliable and secure. ") From 307064275f95012c83f1b3a65c7d5b49df1ddacb Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Thu, 25 Feb 2021 11:43:53 +0300 Subject: [PATCH 28/28] Switch back to build-docs@v1 --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fb4e6b0..a962a6b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -49,7 +49,7 @@ jobs: if: steps.cache.outputs.cache-hit == 'true' - uses: 40ants/setup-lisp@test-cache if: steps.cache.outputs.cache-hit != 'true' - - uses: 40ants/build-docs@v2-alpha + - uses: 40ants/build-docs@v1 with: asdf-system: docs # ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }}