Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

./gradlew build is 'Compiling and testing with Java 21' although actions/setup-java@v4 is setting Java 17 #714

Copy link
Copy link
@GabeGiro

Description

@GabeGiro
Issue body actions

Description:
./gradlew build is 'Compiling and testing with Java 21' after actions/setup-java@v4 is setting Java 17.

I tried a lot of things:

Task version:
v3 and v4

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Use this ci.yml in your Android project:

name: CI

on:
  pull_request:
    branches:
      - main
      - dev
  push:
    branches:
      - main
      - dev

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Set up JDK 17
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: '17'

#      - name: Cache Gradle packages
#        uses: actions/cache@v4
#        with:
#          path: |
#            ~/.gradle/caches
#            ~/.gradle/wrapper/
#          key: ${{ runner.os }}-gradle-v1-${{ hashFiles('**/build.gradle', '**/build.gradle.kts', '**/settings.gradle', '**/settings.gradle.kts', '**/gradle.lockfile') }}
#          restore-keys: |
#            ${{ runner.os }}-gradle-v1-

      - name: Grant execute permission for Gradle Wrapper
        run: chmod +x ./gradlew

      - name: Build with Gradle
        run: ./gradlew build

      - name: Run Unit Tests
        run: ./gradlew test

      - name: Notify Success
        if: success()
        run: echo "Build and tests passed!"

      - name: Notify Failure
        if: failure()
        run: echo "Build or tests failed!"

Note: I commented out the cache for the purpose of making sure that I'm not reusing gradle files

Expected behavior:
Build with Gradle step should show:
Compiling and testing with Java 17

Actual behavior:
Build with Gradle step shows:
Compiling and testing with Java 21

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.