Skip to content

Commit

Permalink
为工作流添加缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
OldGodShen committed Jun 7, 2024
1 parent 2a950c2 commit 008f913
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/tauri ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache bun dependencies
uses: actions/cache@v3
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install bun
run: powershell -c "irm bun.sh/install.ps1 | iex"

Expand All @@ -28,6 +52,24 @@ jobs:
- name: Install dependencies
run: bun install

- name: Cache Rust build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Cache Gradle files
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Rust Android Target
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/tauri release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,60 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache bun dependencies
uses: actions/cache@v3
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install bun
run: powershell -c "irm bun.sh/install.ps1 | iex"

- name: Add bun to PATH
run: echo "C:\Users\runneradmin\.bun\bin" >> $env:GITHUB_PATH

- name: Verify bun installation
run: bun --version

- name: Install dependencies
run: bun install

- name: Cache Rust build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Cache Gradle files
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install bun
run: powershell -c "irm bun.sh/install.ps1 | iex"

Expand Down

0 comments on commit 008f913

Please sign in to comment.