From d5b194bf0000d29ad20e179a23ed1a5e3135a4f3 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sat, 16 May 2026 14:02:38 +0800 Subject: [PATCH] Update README with Rust-only examples --- README.md | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index efa02c4..8b38556 100644 --- a/README.md +++ b/README.md @@ -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