Merge pull request #81 from sakata1222/chore/gradle-8.5 #36
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Java CI with Gradle | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Gradle binary cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/wrapper/ | |
key: gradle-wrapper-${{ hashFiles('plugin/src/functionalTest/resources/gradleVersions.csv') }} | |
restore-keys: | | |
gradle-wrapper- | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build and analysis with Gradle | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew build sonarqube --stacktrace | |
- uses: codecov/codecov-action@v3 | |
with: | |
file: plugin/build/reports/jacoco/test/jacocoTestReport.xml | |
flags: unittests | |
fail_ci_if_error: true | |
verbose: true | |
- name: Publish gradle plugin | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
echo "gradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}" > ~/.gradle/gradle.properties | |
echo "gradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}" >> ~/.gradle/gradle.properties | |
./gradlew publishPlugins |