Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions config-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,21 @@ runs:

rm -f gradle-md5-sums.txt

- name: Sanitize workflow name for cache key
id: sanitize_workflow
if: steps.config-gradle-completed.outputs.skip != 'true' && inputs.disable-caching == 'false'
shell: bash
env:
WORKFLOW_NAME: ${{ github.workflow }}
run: echo "workflow_name=${WORKFLOW_NAME// /-}" >> "$GITHUB_OUTPUT"

- name: Gradle Cache
uses: SonarSource/gh-action_cache@v1
if: steps.config-gradle-completed.outputs.skip != 'true' && inputs.disable-caching == 'false'
with:
path: ${{ inputs.cache-paths }}
key: gradle-${{ runner.os }}-${{ github.workflow }}-${{ env.GRADLE_CACHE_KEY }}
restore-keys: gradle-${{ runner.os }}-${{ github.workflow }}-
key: gradle-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-${{ env.GRADLE_CACHE_KEY }}
restore-keys: gradle-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-

# $GRADLE_USER_HOME is typically set to ~/.gradle/ by gradle/actions/setup-gradle
- name: Configure Gradle Authentication
Expand Down
14 changes: 12 additions & 2 deletions config-maven/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,23 @@ runs:
fi
fi

- name: Sanitize workflow name for cache key
id: sanitize_workflow
if: steps.config-maven-completed.outputs.skip != 'true' && inputs.disable-caching == 'false'
shell: bash
env:
WORKFLOW_NAME: ${{ github.workflow }}
run: echo "workflow_name=${WORKFLOW_NAME// /-}" >> "$GITHUB_OUTPUT"

- name: Cache local Maven repository
uses: SonarSource/gh-action_cache@v1
if: steps.config-maven-completed.outputs.skip != 'true' && inputs.disable-caching == 'false'
with:
path: ${{ inputs.cache-paths }}
key: maven-${{ runner.os }}-${{ github.workflow }}-${{ hashFiles(format('{0}/**/pom.xml', inputs.working-directory)) }}
restore-keys: maven-${{ runner.os }}-${{ github.workflow }}-
# yamllint disable rule:line-length
key: maven-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-${{ hashFiles(format('{0}/**/pom.xml', inputs.working-directory)) }}
# yamllint enable rule:line-length
restore-keys: maven-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-

- name: Update project version and set current-version and project-version variables
id: set-version
Expand Down
12 changes: 10 additions & 2 deletions config-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,21 @@ runs:
rmdir "${{ steps.setup.outputs.MISE_BACKUP }}"
echo "::endgroup::"

- name: Sanitize workflow name for cache key
id: sanitize_workflow
if: ${{ inputs.cache-npm == 'true' }}
shell: bash
env:
WORKFLOW_NAME: ${{ github.workflow }}
run: echo "workflow_name=${WORKFLOW_NAME// /-}" >> "$GITHUB_OUTPUT"

- name: Cache NPM dependencies
uses: SonarSource/gh-action_cache@v1
if: ${{ inputs.cache-npm == 'true' }}
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ github.workflow }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-${{ runner.os }}-${{ github.workflow }}-
key: npm-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-

- name: Check for package.json
id: check_package_json
Expand Down
14 changes: 12 additions & 2 deletions config-pip/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,22 @@ runs:
ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
run: $ACTION_PATH_CONFIG_PIP/config.sh

- name: Sanitize workflow name for cache key
id: sanitize_workflow
if: inputs.disable-caching == 'false'
shell: bash
env:
WORKFLOW_NAME: ${{ github.workflow }}
run: echo "workflow_name=${WORKFLOW_NAME// /-}" >> "$GITHUB_OUTPUT"

- name: Cache pip dependencies
uses: SonarSource/gh-action_cache@v1
if: inputs.disable-caching == 'false'
with:
path: ${{ inputs.cache-paths }}
key: pip-${{ runner.os }}-${{ github.workflow }}-${{ hashFiles(format('{0}/requirements*.txt', inputs.working-directory),
# yamllint disable rule:line-length
key: pip-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-${{ hashFiles(format('{0}/requirements*.txt', inputs.working-directory),
format('{0}/Pipfile.lock', inputs.working-directory), format('{0}/poetry.lock', inputs.working-directory),
format('{0}/pyproject.toml', inputs.working-directory)) }}
restore-keys: pip-${{ runner.os }}-${{ github.workflow }}-
# yamllint enable rule:line-length
restore-keys: pip-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-