Skip to content

Commit

Permalink
Merge pull request #1558 from grails/javaCiWorkflow
Browse files Browse the repository at this point in the history
Update Java CI workflow to use gradle-build-action
  • Loading branch information
puneetbehl committed Nov 29, 2021
2 parents c69add9 + c356449 commit 2f93a27
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,42 @@ jobs:
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Optional setup step
run: |
[ -f ./setup.sh ] && ./setup.sh || true
- name: Run Tests
run: |
./gradlew --no-daemon --refresh-dependencies clean check
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: clean check
- name: Run Build
if: github.event_name == 'push'
id: build
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: clean build
- name: Publish Test Report
if: failure()
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Run Assemble
if: success() && github.event_name == 'push' && matrix.java == '8'
run: ./gradlew assemble
- name: Publish to repo.grails.org
if: success() && github.event_name == 'push' && matrix.java == '8'
id: publish
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true publish
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Extract branch name
if: success() && github.event_name == 'push' && matrix.java == '8'
if: steps.publish.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
id: extract_branch
run: echo ::set-output name=value::${GITHUB_REF:11}
- name: Create Snapshot Message for the Workflow Dispatch
Expand Down

0 comments on commit 2f93a27

Please sign in to comment.