Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gradle.yml #397

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 38 additions & 21 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,29 @@ name: Java CI
on:
push:
branches:
- master
- '[3-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[3-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
java: ['11', '14', '17']
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Run Tests
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: check
- name: Run Build
if: github.event_name == 'push'
id: build
uses: gradle/gradle-build-action@v2
env:
Expand All @@ -40,8 +33,26 @@ jobs:
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: build
- name: Upload Artifacts
if: steps.build.outcome == 'success' && matrix.java == '11'
uses: actions/upload-artifact@v3
with:
name: grails-gsp.zip
path: build/libs/grails-gsp-*.zip
publish:
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Publish to repo.grails.org
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
Expand All @@ -51,15 +62,21 @@ jobs:
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
arguments: publish
- name: Publish Test Report
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
docs:
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
distribution: 'adopt'
java-version: '11'
- name: Build Docs
id: docs
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
uses: gradle/gradle-build-action@v2
with:
arguments: docs
Expand All @@ -68,12 +85,12 @@ jobs:
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Publish to Github Pages
if: steps.docs.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
uses: micronaut-projects/github-pages-deploy-action@master
if: steps.docs.outcome == 'success'
uses: grails/github-pages-deploy-action@v2
env:
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
COMMIT_EMAIL: behlp@objectcomputing.com
COMMIT_NAME: Puneet Behl
COMMIT_EMAIL: behlp@unityfoundation.io
COMMIT_NAME: Puneet Behl
Loading