From 6ed7ad811f6a11019a4a5e975e63416843493594 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Sun, 12 Nov 2023 17:41:07 +0800 Subject: [PATCH] chore: Optimize action --- .github/workflows/release_test.yml | 34 +++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml index 70959e23e..efe2b5dec 100644 --- a/.github/workflows/release_test.yml +++ b/.github/workflows/release_test.yml @@ -62,10 +62,11 @@ jobs: - name: Copy JRE to static directory run: | mkdir -p chat2db-client/static/jre - cp -r "${JAVA_HOME}" chat2db-client/static/jre - if [[ "${{ runner.os }}" != "Windows" ]]; then + cp -r "$JAVA_HOME" chat2db-client/static/jre + if [ "${{ runner.os }}" != "Windows" ]; then chmod -R 777 chat2db-client/static/jre fi + shell: bash env: JAVA_HOME: ${{ env.JAVA_HOME }} @@ -83,15 +84,23 @@ jobs: distribution: "temurin" cache: "maven" - - name: Cache Yarn dependencies - uses: actions/cache@v3 + - name: Cache Yarn Dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + node_modules + key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }} + + - name: Restore Yarn Cache + uses: actions/cache@v2 with: path: | - ${{ runner.temp }}/yarn - ${{ runner.temp }}/node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + ~/.cache/yarn + node_modules + key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-yarn- + {{ runner.os }}-yarn-{{ runner.os }}- - name: Build FE Static run: | @@ -188,3 +197,12 @@ jobs: "title": "${{ matrix.os }}-test-打包完成通知", "text": "# ${{ matrix.os }}-test-打包完成通知\n ![bang](https://oss.sqlgpt.cn/static/bang100.gif)\n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }})\n ### 下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/${{ matrix.os }}-Test${{ matrix.file_extension }}](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/${{ matrix.os }}-Test${{ matrix.file_extension }})" } + + - name: Save Yarn Cache + uses: actions/cache@v2 + with: + path: | + ~/.cache/yarn + node_modules + key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }} + save-key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }}