Skip to content

Commit 6ed7ad8

Browse files
committed
chore: Optimize action
1 parent 1446275 commit 6ed7ad8

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

.github/workflows/release_test.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ jobs:
6262
- name: Copy JRE to static directory
6363
run: |
6464
mkdir -p chat2db-client/static/jre
65-
cp -r "${JAVA_HOME}" chat2db-client/static/jre
66-
if [[ "${{ runner.os }}" != "Windows" ]]; then
65+
cp -r "$JAVA_HOME" chat2db-client/static/jre
66+
if [ "${{ runner.os }}" != "Windows" ]; then
6767
chmod -R 777 chat2db-client/static/jre
6868
fi
69+
shell: bash
6970
env:
7071
JAVA_HOME: ${{ env.JAVA_HOME }}
7172

@@ -83,15 +84,23 @@ jobs:
8384
distribution: "temurin"
8485
cache: "maven"
8586

86-
- name: Cache Yarn dependencies
87-
uses: actions/cache@v3
87+
- name: Cache Yarn Dependencies
88+
uses: actions/cache@v2
89+
with:
90+
path: |
91+
~/.cache/yarn
92+
node_modules
93+
key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }}
94+
95+
- name: Restore Yarn Cache
96+
uses: actions/cache@v2
8897
with:
8998
path: |
90-
${{ runner.temp }}/yarn
91-
${{ runner.temp }}/node_modules
92-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
99+
~/.cache/yarn
100+
node_modules
101+
key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }}
93102
restore-keys: |
94-
${{ runner.os }}-yarn-
103+
{{ runner.os }}-yarn-{{ runner.os }}-
95104
96105
- name: Build FE Static
97106
run: |
@@ -188,3 +197,12 @@ jobs:
188197
"title": "${{ matrix.os }}-test-打包完成通知",
189198
"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 }})"
190199
}
200+
201+
- name: Save Yarn Cache
202+
uses: actions/cache@v2
203+
with:
204+
path: |
205+
~/.cache/yarn
206+
node_modules
207+
key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }}
208+
save-key: {{ runner.os }}-yarn-{{ hashFiles('**/yarn.lock') }}

0 commit comments

Comments
 (0)