Skip to content
Draft
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
13 changes: 11 additions & 2 deletions build-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,16 @@ runs:
if: ${{ inputs.disable-caching != 'true' }}
shell: bash
run: |
set -x
echo "SHELL: $SHELL BASH_VERSION: $BASH_VERSION BASH: $BASH"
ls -la *.gradle *.gradle.kts gradle/libs.versions.toml gradle/wrapper/gradle-wrapper.properties 2>/dev/null || true
/usr/bin/find --version
/usr/bin/find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f
/usr/bin/find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} +
/usr/bin/find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \;
type sort
# Generate cache key from all Gradle files
find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; | sort > gradle-md5-sums.txt
/usr/bin/find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; > gradle-md5-sums.txt
md5sum gradle/libs.versions.toml gradle/wrapper/gradle-wrapper.properties 2>/dev/null >> gradle-md5-sums.txt || true

GRADLE_CACHE_KEY=$(md5sum gradle-md5-sums.txt | awk '{ print $1 }')
Expand All @@ -120,10 +128,11 @@ runs:
echo "GRADLE_CACHE_KEY=${GRADLE_CACHE_KEY}" >> "$GITHUB_ENV"

rm -f gradle-md5-sums.txt
set +x

- name: Restore Gradle Cache
if: ${{ inputs.disable-caching != 'true' }}
uses: SonarSource/gh-action_cache@v1
uses: SonarSource/ci-github-actions/cache@v1
id: gradle-cache-restore
with:
path: ${{ inputs.cache-paths }}
Expand Down
2 changes: 1 addition & 1 deletion promote/promote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MULTI_REPO_SRC_PRIVATE=sonarsource-private-qa
MULTI_REPO_SRC_PUBLIC=sonarsource-public-qa

set_build_env() {
DEFAULT_BRANCH=${DEFAULT_BRANCH:=$(gh repo view --json defaultBranchRef --jq ".defaultBranchRef.name")}
: "${DEFAULT_BRANCH:=$(gh repo view --json defaultBranchRef --jq ".defaultBranchRef.name")}"
export DEFAULT_BRANCH
}

Expand Down
Loading