From 1f89eb272be60a3c16a4962ac4751c0f3aae0a4c Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 31 Aug 2021 09:04:03 +0200 Subject: [PATCH] GitHub Actions: Use Gradle cache provided with `actions/setup-java` --- .github/workflows/build.yml | 46 +++++++----------------------- .github/workflows/release.yml | 25 ++++------------ .github/workflows/run-ui-tests.yml | 9 +++--- CHANGELOG.md | 3 +- 4 files changed, 23 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c051cc..8fa4e37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,30 +44,17 @@ jobs: runs-on: ubuntu-latest steps: + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v2.3.4 + # Setup Java 11 environment for the next steps - name: Setup Java uses: actions/setup-java@v2 with: distribution: zulu java-version: 11 - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Cache Gradle dependencies - - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.6 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} - - # Cache Gradle Wrapper - - name: Setup Gradle Wrapper Cache - uses: actions/cache@v2.1.6 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + cache: gradle # Set environment variables - name: Export Properties @@ -110,30 +97,17 @@ jobs: changelog: ${{ steps.properties.outputs.changelog }} steps: + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v2.3.4 + # Setup Java 11 environment for the next steps - name: Setup Java uses: actions/setup-java@v2 with: distribution: zulu java-version: 11 - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 - - # Cache Gradle Dependencies - - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.6 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} - - # Cache Gradle Wrapper - - name: Setup Gradle Wrapper Cache - uses: actions/cache@v2.1.6 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + cache: gradle # Set environment variables - name: Export Properties diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16dce77..b023e60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,32 +14,19 @@ jobs: runs-on: ubuntu-latest steps: - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 11 - # Check out current repository - name: Fetch Sources uses: actions/checkout@v2.3.4 with: ref: ${{ github.event.release.tag_name }} - # Cache Gradle Dependencies - - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.6 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} - - # Cache Gradle Wrapper - - name: Setup Gradle Wrapper Cache - uses: actions/cache@v2.1.6 + # Setup Java 11 environment for the next steps + - name: Setup Java + uses: actions/setup-java@v2 with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + distribution: zulu + java-version: 11 + cache: gradle # Update Unreleased section with the current release note - name: Patch Changelog diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 9bd512c..5d50d40 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -31,16 +31,17 @@ jobs: steps: + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v2.3.4 + # Setup Java 11 environment for the next steps - name: Setup Java uses: actions/setup-java@v2 with: distribution: zulu java-version: 11 - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.3.4 + cache: gradle # Run IDEA prepared for UI testing - name: Run IDE diff --git a/CHANGELOG.md b/CHANGELOG.md index db3ab25..cf88b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ ### Changed - GitHub Actions: Use Java 11 -- GitHub Actions: update Build and Release flows +- GitHub Actions: Update Build and Release flows +- GitHub Actions: Use Gradle cache provided with `actions/setup-java` - Update `pluginVerifierIdeVersions` to `2020.3.4, 2021.1.3, 2021.2` - Change since/until build to `203-212.*` - Upgrade Gradle Wrapper to `7.2`