improve caching in workflow, remove duplicated .net install steps

This commit is contained in:
LukeFZ
2025-09-03 23:04:23 +02:00
parent c94bc1c225
commit 3ae9dba60d

View File

@@ -26,6 +26,7 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: lts/* node-version: lts/*
cache: "pnpm"
- name: Setup Rust - name: Setup Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
@@ -42,7 +43,8 @@ jobs:
run: pnpm install run: pnpm install
working-directory: ./Il2CppInspector.Redux.GUI.UI working-directory: ./Il2CppInspector.Redux.GUI.UI
- uses: actions/cache@v4 - name: Cache NuGet packages
uses: actions/cache@v4
with: with:
path: ~/.nuget/packages path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-redux-gui-${{ hashFiles('**/packages.lock.json') }} key: ${{ runner.os }}-nuget-redux-gui-${{ hashFiles('**/packages.lock.json') }}
@@ -80,23 +82,19 @@ jobs:
with: with:
submodules: true submodules: true
- name: Setup .NET SDK - name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: '9.0.x' dotnet-version: ${{ matrix.dotnet-version }}
- uses: actions/cache@v3 - name: Cache NuGet packages
uses: actions/cache@v4
with: with:
path: ~/.nuget/packages path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-cli-${{ matrix.rid }}-${{ hashFiles('**/packages.lock.json') }} key: ${{ runner.os }}-nuget-cli-${{ matrix.rid }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-nuget-cli-${{ matrix.rid }}- ${{ runner.os }}-nuget-cli-${{ matrix.rid }}-
- name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies - name: Install dependencies
run: dotnet restore -r ${{ matrix.rid }} ./Il2CppInspector.Redux.CLI run: dotnet restore -r ${{ matrix.rid }} ./Il2CppInspector.Redux.CLI
@@ -153,10 +151,10 @@ jobs:
with: with:
submodules: true submodules: true
- name: Setup .NET SDK - name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: '9.0.x' dotnet-version: ${{ matrix.dotnet-version }}
- uses: actions/cache@v3 - uses: actions/cache@v3
with: with:
@@ -165,11 +163,6 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-nuget-cli-${{ matrix.rid }}- ${{ runner.os }}-nuget-cli-${{ matrix.rid }}-
- name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies - name: Install dependencies
run: dotnet restore -r ${{ matrix.rid }} ./Il2CppInspector.CLI run: dotnet restore -r ${{ matrix.rid }} ./Il2CppInspector.CLI