actions / setup-java

Set up your GitHub Actions workflow with a specific version of Java
MIT License
1.51k stars 730 forks source link

Post Setup JDK 17 takes very long time on local runner #683

Open MartynasObdeleven opened 6 days ago

MartynasObdeleven commented 6 days ago

Description: I have a build script that is run on each PR. It launches appium test suite, which takes approximately 4 minutes to complete, but after that Post Setup JDK 17 takes more than 10 minutes which is strange, since we're using m1 mac studio. Job looks like:

name: Appium Tests

on:
  push:
    branches:
      - "develop"
  pull_request:
    branches:
      - "main"
      - "develop"

jobs:
  appium-tests:
    runs-on: [self-hosted, macOS, ARM64]

    steps:
      - uses: actions/checkout@v4.1.7

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

      - name: Grant execute permission for gradlew
        run: chmod +x gradlew

      - name: Appium Tests (E2E)
        run: |
          chmod +x run_offline_appium_tests.sh
          ./run_offline_appium_tests.sh
        working-directory: scripts

Here's timeline:

image

Task version: 4.3.0

Platform:

Runner type:

Expected behavior: Post Setup takes no more than minute.

Actual behavior: Post Setup takes 10+ minutes.

aparnajyothi-y commented 5 days ago

Hello @MartynasObdeleven, Thank you for creating this issue and we will look into it :)

choppeh commented 1 day ago

v3 is also very slow with JDK 17. Is the cache size Ok?

choppeh commented 1 day ago

I removed cache: gradle and the step was quickly completed

MartynasObdeleven commented 14 hours ago

I had setup java on local machine so it runs fine with:

name: Appium Tests

on:
  push:
    branches:
      - "develop"
  pull_request:
    branches:
      - "main"
      - "develop"

jobs:
  appium-tests:
    runs-on: [self-hosted, macOS, ARM64]

    steps:
      - uses: actions/checkout@v4.1.7

      - name: Grant execute permission for gradlew
        run: chmod +x gradlew

      - name: Appium Tests (E2E)
        run: |
          chmod +x run_offline_appium_tests.sh
          ./run_offline_appium_tests.sh
        working-directory: scripts