ci: 添加Gradle缓存、node_modules缓存和Docker构建缓存
This commit is contained in:
@@ -104,6 +104,7 @@ jobs:
|
|||||||
NODE_ENV: "production"
|
NODE_ENV: "production"
|
||||||
NDK_NUM_JOBS: "4"
|
NDK_NUM_JOBS: "4"
|
||||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||||
|
GRADLE_USER_HOME: /root/.gradle
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
@@ -122,7 +123,28 @@ jobs:
|
|||||||
node-version: '25.6.1'
|
node-version: '25.6.1'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Cache Gradle
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
~/.android/build-cache
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle.properties') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Cache node_modules
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: cache-node-modules
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-modules-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Generate Android native project
|
- name: Generate Android native project
|
||||||
@@ -292,6 +314,8 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
provenance: false
|
provenance: false
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Show image tags
|
- name: Show image tags
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user