Merge pull request #205 from JetBrains/downgrade-jdk #335
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
# Trigger the workflow on pushes to only the 'master' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) | |
push: | |
branches: [master] | |
# Trigger the workflow on any pull request | |
pull_request: | |
jobs: | |
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum | |
gradleValidation: | |
name: Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
# Validate wrapper | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1.1.0 | |
# Run verifyPlugin and test Gradle tasks | |
test: | |
name: Test | |
needs: gradleValidation | |
runs-on: ubuntu-latest | |
steps: | |
# Setup Java 11 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
# Cache Gradle dependencies | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/cache@v3 | |
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@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# Run tests | |
- name: Run Tests | |
run: ./gradlew test | |
- name: Collect CLI Test Results | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results-cli | |
path: ${{ github.workspace }}/cli/build/reports/tests/test/ | |
- name: Collect Lib Test Results | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results-lib | |
path: ${{ github.workspace }}/lib/build/reports/tests/test/ | |
# Run verifyPlugin and test Gradle tasks | |
build: | |
name: Build | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
# Setup Java 11 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
# Cache Gradle dependencies | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/cache@v3 | |
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@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
# Run build | |
- name: Run Build | |
run: ./gradlew build |