Update README with Rust-only examples

This commit is contained in:
2026-05-16 14:02:38 +08:00
parent 48e43c2ed3
commit d5b194bf00
+11 -28
View File
@@ -35,28 +35,10 @@ jobs:
- run: echo "Cache restored, proceeding with build..."
```
### With Custom Key File
### Rust Example
```yaml
name: Build with Cache
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Actions/Cache@main
with:
key-file: 'package-lock.json'
- run: npm ci
- run: npm run build
```
### .NET Example
```yaml
name: .NET Build
name: Rust Build
on: push
defaults:
@@ -70,16 +52,15 @@ jobs:
- uses: actions/checkout@v4
- uses: Actions/Cache@main
with:
key-file: '**/*.csproj'
key-file: 'Cargo.lock'
path: |
~/.cache/
~/.nuget/packages
~/.cargo/registry
~/.cargo/git
target
- name: Build
working-directory: src/
run: |
dotnet restore
dotnet build --no-restore -c Release
dotnet publish --no-build -c Release
cargo build --release
```
### Skip Steps on Cache Hit
@@ -96,10 +77,12 @@ jobs:
- uses: Actions/Cache@main
id: cache
with:
key-file: 'requirements.txt'
key-file: 'Cargo.lock'
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements.txt
run: cargo fetch
- name: Build
run: cargo build --release
```
## How It Works