Update README with Rust-only examples
This commit is contained in:
@@ -35,28 +35,10 @@ jobs:
|
|||||||
- run: echo "Cache restored, proceeding with build..."
|
- run: echo "Cache restored, proceeding with build..."
|
||||||
```
|
```
|
||||||
|
|
||||||
### With Custom Key File
|
### Rust Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Build with Cache
|
name: Rust Build
|
||||||
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
|
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -70,16 +52,15 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Actions/Cache@main
|
- uses: Actions/Cache@main
|
||||||
with:
|
with:
|
||||||
key-file: '**/*.csproj'
|
key-file: 'Cargo.lock'
|
||||||
path: |
|
path: |
|
||||||
~/.cache/
|
~/.cache/
|
||||||
~/.nuget/packages
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: src/
|
|
||||||
run: |
|
run: |
|
||||||
dotnet restore
|
cargo build --release
|
||||||
dotnet build --no-restore -c Release
|
|
||||||
dotnet publish --no-build -c Release
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Skip Steps on Cache Hit
|
### Skip Steps on Cache Hit
|
||||||
@@ -96,10 +77,12 @@ jobs:
|
|||||||
- uses: Actions/Cache@main
|
- uses: Actions/Cache@main
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
key-file: 'requirements.txt'
|
key-file: 'Cargo.lock'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
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
|
## How It Works
|
||||||
|
|||||||
Reference in New Issue
Block a user