Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
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
56 changes: 30 additions & 26 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: Java CI
on:
push:
branches:
- master
- '[7-9]+.[1-9]+.x'
- '[6-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[7-9]+.[1-9]+.x'
- '[6-9]+.[0-9]+.x'
workflow_dispatch:
inputs:
message:
Expand All @@ -30,54 +28,60 @@ jobs:
DISPATCH_INFORMATION: ${{ github.event.inputs.message }}
run: echo $DISPATCH_INFORMATION
- 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: Start MongoDB
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Compile and Run Tests
run: |
./gradlew compileGroovy --no-daemon
./gradlew compileTestGroovy --no-daemon
./gradlew -Dgeb.env=chromeHeadless check --no-daemon
- name: Run Tests
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: check -Dgeb.env=chromeHeadless
- 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: build -Dgeb.env=chromeHeadless
- name: Publish Test Report
if: failure()
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- 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
echo "Publishing Documentation..."
./gradlew docs:docs
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Build Docs
id: docs
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
uses: gradle/gradle-build-action@v2
with:
arguments: docs:docs
- name: Determine docs target repository
if: success() && github.event_name == 'push' && matrix.java == '8'
if: steps.docs.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
uses: haya14busa/action-cond@v1
id: docs_target
with:
cond: ${{ github.repository == 'grails/gorm-mongodb' }}
if_true: "grails/grails-data-mapping"
if_false: ${{ github.repository }}
- name: Publish to Github Pages
if: success() && github.event_name == 'push' && matrix.java == '8'
if: steps.docs.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
uses: micronaut-projects/github-pages-deploy-action@master
env:
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
Expand Down