Skip to content

Commit

Permalink
fix: adds workaround hashFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-sartori-zupit committed Dec 4, 2024
1 parent ddd88cd commit 78abaa5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
23 changes: 15 additions & 8 deletions .github/actions/dotnet/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@ inputs:
runs:
using: composite
steps:
- name: Create folder if not exist
shell: bash
run: mkdir -p ~/.nuget/packages${{ inputs.CACHE_SUFFIX }}

- name: Restore NuGet packages cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.nuget/packages${{ inputs.CACHE_SUFFIX }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ github.run_id }}-${{ github.run_attempt }} # Temporary fix: ${{ hashFiles(format('{0}/**/packages.lock.json', inputs.WORKING_DIRECTORY)) }}
restore-keys: ${{ runner.os }}-nuget-
# - name: Create folder if not exist
# shell: bash
# run: mkdir -p ~/.nuget/packages${{ inputs.CACHE_SUFFIX }}

# - name: Restore NuGet packages cache
# uses: actions/cache@v3
# with:
# path: ~/.nuget/packages${{ inputs.CACHE_SUFFIX }}
# # key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
# key: ${{ runner.os }}-nuget-${{ github.run_id }}-${{ github.run_attempt }} # Temporary fix: ${{ hashFiles(format('{0}/**/packages.lock.json', inputs.WORKING_DIRECTORY)) }}
# restore-keys: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}

- name: Restore dependencies
shell: ${{ inputs.SHELL }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/dotnet/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ inputs:
SHELL:
required: false
type: string
default: 'bash'
default: "bash"

runs:
using: composite
steps:
- name: Build
uses: zupit-it/pipeline-templates/.github/actions/dotnet/build@v1.24.0
uses: zupit-it/pipeline-templates/.github/actions/dotnet/build@ZCH-126/caching
with:
WORKING_DIRECTORY: ${{ inputs.WORKING_DIRECTORY }}
BUILD_CONFIG: ${{ inputs.BUILD_CONFIG }}
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/dotnet-step-azure-webapp-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
RUN_ON:
required: false
type: string
default: 'zupit-agents'
default: "zupit-agents"
RUNNERS_CONTAINER_GROUP:
required: false
type: string
default: 'Container'
default: "Container"
RELEASE_ENVIRONMENT:
required: true
type: string
Expand All @@ -26,21 +26,20 @@ on:
CHECKOUT_REF:
required: false
type: string
default: ''
default: ""
ENV_VARIABLES:
required: false
type: string
default: '{}'
default: "{}"
DOTNET_IMAGE:
required: false
type: string
default: 'mcr.microsoft.com/dotnet/sdk:7.0'
default: "mcr.microsoft.com/dotnet/sdk:7.0"
AZURE_CLI_IMAGE:
required: false
type: string
default: "mcr.microsoft.com/azure-cli:2.50.0"


env: "${{secrets}}"

jobs:
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
NAME_PREFIX: dotnet-build

- name: Build
uses: zupit-it/pipeline-templates/.github/actions/dotnet/release@v1.24.0
uses: zupit-it/pipeline-templates/.github/actions/dotnet/release@ZCH-126/caching
with:
WORKING_DIRECTORY: ${{ inputs.WORKING_DIRECTORY }}
BUILD_CONFIG: "Release"
Expand All @@ -94,7 +93,7 @@ jobs:
container:
image: ${{ inputs.AZURE_CLI_IMAGE }}

needs: [ build ]
needs: [build]
steps:
- name: Download build artifact
id: output-folder
Expand All @@ -106,6 +105,6 @@ jobs:
uses: zupit-it/pipeline-templates/.github/actions/azure/app-service/[email protected]
with:
WORKING_DIRECTORY: ${{ steps.output-folder.outputs.OUTPUT_FOLDER }}
BINARIES_DIRECTORY: ''
BINARIES_DIRECTORY: ""
AZURE_CREDENTIALS: ${{ secrets.CI_AZURE_CREDENTIALS }}
WEBAPP_NAME: ${{ inputs.WEBAPP_NAME }}
2 changes: 1 addition & 1 deletion .github/workflows/sonar-step-dotnet-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
uses: actions/checkout@v4

- name: Install .NET
uses: zupit-it/pipeline-templates/.github/actions/dotnet/install@v1.24.0
uses: zupit-it/pipeline-templates/.github/actions/dotnet/install@ZCH-126/caching
with:
WORKING_DIRECTORY: ${{ inputs.WORKING_DIRECTORY }}
DOTNET_VERSION: ${{ inputs.DOTNET_VERSION }}
Expand Down

0 comments on commit 78abaa5

Please sign in to comment.