[action] Let gbs action cache 'GBS-ROOT/local/cache'
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Tue, 31 Oct 2023 05:44:32 +0000 (14:44 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Thu, 2 Nov 2023 03:28:04 +0000 (12:28 +0900)
- Let github action cache the directory. Speed gbs build up by removing
  package downloads.
- The cache key is the date. The very first run each day will make new
  cache.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
.github/workflows/gbs_x64.yml

index e4ca30e..f25c1c8 100644 (file)
@@ -20,6 +20,16 @@ jobs:
       run: sudo apt-get update && sudo apt-get install -y gbs
     - name: configure GBS
       run: cp .github/workflows/tizen.gbs.conf ~/.gbs.conf
+    - name: make cache key
+      id: make-key
+      run: echo "cache_key=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
+      shell: bash
+    - name: cache gbs cache
+      id: cache-gbs-root
+      uses: actions/cache@v3
+      with:
+        path: ~/GBS-ROOT/local/cache
+        key: ${{ steps.make-key.outputs.cache_key }}
     - name: run GBS
       run: gbs build
     - name: get nntrainer