Skip to content

Commit

Permalink
Improve GitHub actions (#587 / #611)
Browse files Browse the repository at this point in the history
Adds an own action just for Spotless and removes it from the
test-executing builds, which reduces the overall build time.

Relates to: #587
PR: #611
  • Loading branch information
p1729 committed May 21, 2022
1 parent a8a3c08 commit 4b6c620
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,34 @@ jobs:
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
arguments: --refresh-dependencies --stacktrace --scan clean build
arguments: --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck
- name: SonarCloud analysis
if: ${{ matrix.os == 'ubuntu' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: "61ab2579215aa8a0024a2f9368fc1298fdecfd18"
run: ./gradlew jacocoTestReport sonarqube --stacktrace -i

# Code format check
code-format-check:
runs-on: ubuntu-latest
needs: validation
timeout-minutes: 15
name: Code format check
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: 11
distribution: temurin
cache: 'gradle'
- name: Spotless check
uses: gradle/gradle-build-action@v2
with:
arguments: --scan spotlessCheck

# Our full integration job, which will build for a matrix out of our supported
# Java versions, operating systems, modular or not, and various JUnit versions.
# This build is executed on all tags and the default branch. Furthermore, we will
Expand Down Expand Up @@ -114,7 +134,7 @@ jobs:
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
arguments: --refresh-dependencies -PmodularBuild=${{ matrix.modular }} -PjunitVersion=${{ matrix.junit-version }} --stacktrace --scan clean build
arguments: --refresh-dependencies -PmodularBuild=${{ matrix.modular }} -PjunitVersion=${{ matrix.junit-version }} --stacktrace --scan clean build -x spotlessCheck

# We want to be up-to-date and know issues with future Java versions as soon as possible.
# Furthermore, we also would love to see our build working with the latest Gradle version.
Expand Down Expand Up @@ -161,7 +181,7 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
gradle-version: release-candidate
arguments: --refresh-dependencies -PexperimentalJavaVersion=${{ env.EXPERIMENTAL_JAVA }} -PmodularBuild=${{ matrix.modular }} -PjunitVersion=${{ matrix.junit-version }} -Porg.gradle.java.installations.auto-download=false --stacktrace --scan clean build
arguments: --refresh-dependencies -PexperimentalJavaVersion=${{ env.EXPERIMENTAL_JAVA }} -PmodularBuild=${{ matrix.modular }} -PjunitVersion=${{ matrix.junit-version }} -Porg.gradle.java.installations.auto-download=false --stacktrace --scan clean build -x spotlessCheck

# A release will be created if there is a `version` defined and `releasing` is set to `true`.
# If not, this stage will be ignored.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ The least we can do is to thank them and list some of their accomplishments here

#### 2022

* [Pankaj Kumar](https://github.com/p1729) contributed towards improving GitHub actions (#587 / #611)
* [Filip Hrisafov](https://github.com/filiphr) contributed the [JSON Argument Source](https://junit-pioneer.org/docs/json-argument-source/) support (#101 / #492)

#### 2021
Expand Down

0 comments on commit 4b6c620

Please sign in to comment.