mirror of
				https://hub.gitmirror.com/https://github.com/gradle/actions.git
				synced 2025-10-31 18:10:00 +08:00 
			
		
		
		
	![dependabot[bot]](/assets/img/avatar_default.png) d2f575bd22
			
		
	
	
		d2f575bd22
		
			
		
	
	
	
	
		
			
			Bumps the github-actions group with 2 updates in the / directory: [github/codeql-action](https://github.com/github/codeql-action) and [actions/setup-java](https://github.com/actions/setup-java). Bumps the github-actions group with 1 update in the /.github/actions/init-integ-test directory: [actions/setup-java](https://github.com/actions/setup-java). Updates `github/codeql-action` from 3.29.10 to 3.29.11 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](96f518a34f...3c3833e0f8) Updates `actions/setup-java` from 4.7.1 to 5.0.0 - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](c5195efecf...dded088883) Updates `actions/setup-java` from 4.7.1 to 5.0.0 - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](c5195efecf...dded088883) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/setup-java dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-java dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
		
			
				
	
	
		
			99 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			99 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Test detect java toolchains
 | |
| 
 | |
| on:
 | |
|   workflow_call:
 | |
|     inputs:
 | |
|       cache-key-prefix:
 | |
|         type: string
 | |
|         default: '0'
 | |
|       runner-os:
 | |
|         type: string
 | |
|         default: '["ubuntu-latest"]'
 | |
|       skip-dist:
 | |
|         type: boolean
 | |
|         default: false
 | |
| 
 | |
| env:
 | |
|   SKIP_DIST: ${{ inputs.skip-dist }}
 | |
|   GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: detect-java-toolchain-${{ inputs.cache-key-prefix }}
 | |
| 
 | |
| permissions:
 | |
|   contents: read
 | |
| 
 | |
| jobs:
 | |
|   # Test that pre-installed runner JDKs are detected
 | |
|   detect-toolchains-pre-installed-jdks:
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         os: ${{fromJSON(inputs.runner-os)}}
 | |
|     runs-on: ${{ matrix.os }}
 | |
|     steps:
 | |
|     - name: Checkout sources
 | |
|       uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
 | |
|     - name: Initialize integ-test
 | |
|       uses: ./.github/actions/init-integ-test
 | |
| 
 | |
|     - name: Setup Gradle
 | |
|       uses: ./setup-gradle
 | |
|     - name: List detected toolchains
 | |
|       shell: bash
 | |
|       working-directory: .github/workflow-samples/groovy-dsl
 | |
|       run: | 
 | |
|         ./gradlew --info javaToolchains > output.txt
 | |
|         cat output.txt
 | |
|     - name: Verify detected toolchains
 | |
|       shell: bash
 | |
|       working-directory: .github/workflow-samples/groovy-dsl
 | |
|       run: | 
 | |
|         grep -q 'Eclipse Temurin JDK 8' output.txt || (echo "::error::Did not detect preinstalled JDK 8" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 11' output.txt || (echo "::error::Did not detect preinstalled JDK 11" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 17' output.txt || (echo "::error::Did not detect preinstalled JDK 17" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 21' output.txt || (echo "::error::Did not detect preinstalled JDK 21" && exit 1)
 | |
| 
 | |
|   # Test that JDKs provisioned by setup-java are detected
 | |
|   detect-toolchains-setup-java-jdks:
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         os: ${{fromJSON(inputs.runner-os)}}
 | |
|     runs-on: ${{ matrix.os }}
 | |
|     steps:
 | |
|     - name: Checkout sources
 | |
|       uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
 | |
|     - name: Initialize integ-test
 | |
|       uses: ./.github/actions/init-integ-test
 | |
| 
 | |
|     - name: Setup Java 16
 | |
|       uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
 | |
|       with:
 | |
|         distribution: 'temurin'
 | |
|         java-version: 16
 | |
|     - name: Setup Java 20
 | |
|       uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
 | |
|       with:
 | |
|         distribution: 'temurin'
 | |
|         java-version: 20
 | |
|     - name: Setup Gradle
 | |
|       uses: ./setup-gradle
 | |
|     - name: List detected toolchains
 | |
|       shell: bash
 | |
|       working-directory: .github/workflow-samples/groovy-dsl
 | |
|       run: | 
 | |
|         ./gradlew --info javaToolchains > output.txt
 | |
|         cat output.txt
 | |
|     - name: Verify setup JDKs are detected
 | |
|       shell: bash
 | |
|       working-directory: .github/workflow-samples/groovy-dsl
 | |
|       run: | 
 | |
|         grep -q 'Eclipse Temurin JDK 16' output.txt || (echo "::error::Did not detect setup-java installed JDK 16" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 20' output.txt || (echo "::error::Did not detect setup-java installed JDK 20" && exit 1)
 | |
|     - name: Verify pre-installed toolchains are detected
 | |
|       shell: bash
 | |
|       working-directory: .github/workflow-samples/groovy-dsl
 | |
|       run: | 
 | |
|         grep -q 'Eclipse Temurin JDK 8' output.txt || (echo "::error::Did not detect preinstalled JDK 8" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 11' output.txt || (echo "::error::Did not detect preinstalled JDK 11" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 17' output.txt || (echo "::error::Did not detect preinstalled JDK 17" && exit 1)
 | |
|         grep -q 'Eclipse Temurin JDK 21' output.txt || (echo "::error::Did not detect preinstalled JDK 21" && exit 1)
 |