Skip to content

Commit

Permalink
Fix refresh dependency behavior and reduce fetch-depth (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 authored Mar 4, 2024
1 parent 6937be3 commit e57a074
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/java-gradle-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Build
uses: bakdata/ci-templates/actions/java-gradle-build@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-build@1.43.0
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
Expand All @@ -88,7 +88,7 @@ jobs:
needs: build
steps:
- name: Run unit tests
uses: bakdata/ci-templates/actions/java-gradle-test@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-test@1.43.0
with:
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}
Expand All @@ -104,7 +104,7 @@ jobs:
needs: test
steps:
- name: Assess code quality
uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-assess-code-quality@1.43.0
with:
download-lfs-files: ${{ inputs.download-lfs-files }}
gradle-cache: ${{ inputs.gradle-cache }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java-gradle-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ concurrency:
jobs:
build-and-test:
name: Build, Test and Assess code quality
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.42.0
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.43.0
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
Expand All @@ -106,7 +106,7 @@ jobs:

steps:
- name: Build tarball image
uses: bakdata/ci-templates/actions/java-gradle-build-jib@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-build-jib@1.43.0
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
Expand All @@ -123,7 +123,7 @@ jobs:

steps:
- name: Publish
uses: bakdata/ci-templates/actions/java-gradle-publish@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-publish@1.43.0
with:
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
signing-key-id: ${{ secrets.signing-key-id }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/java-gradle-library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ concurrency:
jobs:
build-and-test:
name: Build, Test and Assess code quality
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.42.0
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.43.0
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
Expand All @@ -97,7 +97,7 @@ jobs:

steps:
- name: Publish
uses: bakdata/ci-templates/actions/java-gradle-publish@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-publish@1.43.0
with:
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
signing-key-id: ${{ secrets.signing-key-id }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java-gradle-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ concurrency:
jobs:
build-and-test:
name: Build, Test and Assess code quality
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.42.0
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.43.0
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
Expand All @@ -102,7 +102,7 @@ jobs:

steps:
- name: Publish
uses: bakdata/ci-templates/actions/java-gradle-publish@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-publish@1.43.0
with:
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
signing-key-id: ${{ secrets.signing-key-id }}
Expand All @@ -125,7 +125,7 @@ jobs:

steps:
- name: Publish plugin
uses: bakdata/ci-templates/actions/java-gradle-publish-plugin@1.42.0
uses: bakdata/ci-templates/actions/java-gradle-publish-plugin@1.43.0
with:
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
signing-key-id: ${{ secrets.signing-key-id }}
Expand Down
3 changes: 1 addition & 2 deletions actions/java-gradle-assess-code-quality/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ runs:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
with:
fetch-depth: 0
lfs: ${{ inputs.download-lfs-files }}

- name: Set up Gradle with version ${{ inputs.gradle-version }}
Expand All @@ -71,7 +70,7 @@ runs:
# sonar.branch.autoconfig.disabled is necessary for autocreation of projects on Sonarcloud to work
- name: Assess code quality
if: ${{ inputs.sonar-token != '' && inputs.sonar-organization != '' }}
run: ./gradlew -Dsonar.branch.autoconfig.disabled=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=${{ inputs.sonar-organization }} --info --stacktrace sonarqube ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
run: ./gradlew -Dsonar.branch.autoconfig.disabled=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=${{ inputs.sonar-organization }} --info --stacktrace sonarqube ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
Expand Down
2 changes: 1 addition & 1 deletion actions/java-gradle-build-jib/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ runs:
--image=${{ inputs.image-name }} \
${{ inputs.jib-from-image && format('-Djib.from.image={0}', inputs.jib-from-image) || '' }} \
-x test \
${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}

Expand Down
2 changes: 1 addition & 1 deletion actions/java-gradle-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ runs:
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}

- name: Compile
run: ./gradlew --info --stacktrace build -x test ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
run: ./gradlew --info --stacktrace build -x test ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}

Expand Down
4 changes: 1 addition & 3 deletions actions/java-gradle-publish-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ runs:
steps:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
with:
fetch-depth: 0

- name: Set up Gradle with version ${{ inputs.gradle-version }}
uses: bakdata/ci-templates/actions/[email protected]
Expand All @@ -66,7 +64,7 @@ runs:
run: |
export SIGNING_SECRET_KEY_RING_FILE="$(mktemp -d)/secring.gpg"
echo '${{ inputs.signing-secret-key-ring }}' | base64 -d > $SIGNING_SECRET_KEY_RING_FILE
./gradlew --info --stacktrace -Pgradle.publish.key=${{ inputs.gradle-publish-key }} -Pgradle.publish.secret=${{ inputs.gradle-publish-secret }} publishPlugins -x test ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
./gradlew --info --stacktrace -Pgradle.publish.key=${{ inputs.gradle-publish-key }} -Pgradle.publish.secret=${{ inputs.gradle-publish-secret }} publishPlugins -x test ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
Expand Down
4 changes: 1 addition & 3 deletions actions/java-gradle-publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ runs:
steps:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
with:
fetch-depth: 0

- name: Set up Gradle with version ${{ inputs.gradle-version }}
uses: bakdata/ci-templates/actions/[email protected]
Expand All @@ -67,7 +65,7 @@ runs:
run: |
export SIGNING_SECRET_KEY_RING_FILE="$(mktemp -d)/secring.gpg"
echo '${{ inputs.signing-secret-key-ring }}' | base64 -d > $SIGNING_SECRET_KEY_RING_FILE
./gradlew --info --stacktrace publishToNexus -x test ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
./gradlew --info --stacktrace publishToNexus -x test ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
Expand Down
2 changes: 1 addition & 1 deletion actions/java-gradle-release-github/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ runs:
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}

- name: Generate changelog
run: ./gradlew -Pchangelog.githubRepository=${{ github.event.repository.name }} -Pchangelog.futureVersionTag=${{ github.ref_name }} -Pchangelog.sinceTag=${{ github.ref_name }} --stacktrace --info generateChangelog ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
run: ./gradlew -Pchangelog.githubRepository=${{ github.event.repository.name }} -Pchangelog.futureVersionTag=${{ github.ref_name }} -Pchangelog.sinceTag=${{ github.ref_name }} --stacktrace --info generateChangelog ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
Expand Down
4 changes: 2 additions & 2 deletions actions/java-gradle-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ runs:
shell: bash

- name: Create release
run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -Prelease.disablePushToRemote=true -Prelease.requireBranch=${{ github.event.repository.default_branch }} ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -Prelease.disablePushToRemote=true -Prelease.requireBranch=${{ github.event.repository.default_branch }} ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}

Expand All @@ -101,7 +101,7 @@ runs:
shell: bash

- name: Create changelog
run: ./gradlew -Pchangelog.githubRepository=${{ github.event.repository.name }} -Pchangelog.futureVersionTag=${{ steps.evaluate-version.outputs.release-version }} --stacktrace --info generateChangelog ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
run: ./gradlew -Pchangelog.githubRepository=${{ github.event.repository.name }} -Pchangelog.futureVersionTag=${{ steps.evaluate-version.outputs.release-version }} --stacktrace --info generateChangelog ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
Expand Down
3 changes: 1 addition & 2 deletions actions/java-gradle-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ runs:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
with:
fetch-depth: 0
lfs: ${{ inputs.download-lfs-files }}

- name: Set up Gradle with version ${{ inputs.gradle-version }}
Expand All @@ -54,7 +53,7 @@ runs:
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}

- name: Run tests
run: ./gradlew check --info --stacktrace ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
run: ./gradlew check --info --stacktrace ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}

Expand Down
1 change: 0 additions & 1 deletion actions/java-maven-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ runs:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
with:
fetch-depth: 0
lfs: ${{ inputs.download-lfs-files }}

- name: Set up Maven with version ${{ inputs.maven-version }}
Expand Down

0 comments on commit e57a074

Please sign in to comment.