mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-05 23:34:09 +02:00
feat: Enhance CI workflows to check for source and documentation changes, and cache NuGet packages
feat: Embed appsettings.json as a resource and update configuration loading logic
This commit is contained in:
@@ -28,14 +28,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check for src/ changes
|
||||
id: changes
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git fetch origin ${{ github.base_ref }} --depth=1
|
||||
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'src/' | wc -l)
|
||||
git fetch origin "$BASE_REF" --depth=1
|
||||
CHANGED=$(git diff --name-only "origin/$BASE_REF"...HEAD -- 'src/' | wc -l)
|
||||
if [ "$CHANGED" -gt 0 ]; then
|
||||
echo "src_changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
@@ -48,6 +48,14 @@ jobs:
|
||||
with:
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Cache NuGet packages
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }}
|
||||
restore-keys: nuget-${{ runner.os }}-
|
||||
|
||||
- name: Restore dependencies
|
||||
if: steps.changes.outputs.src_changed == 'true'
|
||||
run: dotnet restore src/EchoHub.slnx
|
||||
|
||||
Reference in New Issue
Block a user