-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from grails/jamesfredley/restore-joint-workflow
Restore joint-workflow and build tests
- Loading branch information
Showing
2 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
name: "Groovy Joint Validation Build" | ||
on: | ||
push: | ||
branches: | ||
- '[5-9]+.[0-9]+.x' | ||
pull_request: | ||
branches: | ||
- '[5-9]+.[0-9]+.x' | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
env: | ||
CI_GROOVY_VERSION: | ||
jobs: | ||
build_groovy: | ||
strategy: | ||
fail-fast: true | ||
runs-on: ubuntu-latest | ||
outputs: | ||
groovyVersion: ${{ steps.groovy-version.outputs.value }} | ||
steps: | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Cache local Maven repository & Groovy | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/groovy | ||
~/.m2/repository | ||
key: cache-local-groovy-maven-${{ github.sha }} | ||
- name: Checkout Groovy 4_0_X (Grails 7 and later) | ||
run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_4_0_X --single-branch | ||
- name: Set CI_GROOVY_VERSION for Grails | ||
id: groovy-version | ||
run: | | ||
cd ../groovy | ||
echo "CI_GROOVY_VERSION=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_ENV | ||
echo "value=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_OUTPUT | ||
- name: Prepare Develocity Setup 1 | ||
id: develocity_conf_1 | ||
run: | | ||
echo "VALUE<<EOF" >> $GITHUB_OUTPUT | ||
echo "plugins { " >> $GITHUB_OUTPUT | ||
echo " id 'com.gradle.enterprise' version '3.15.1'" >> $GITHUB_OUTPUT | ||
echo " id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.11.3'" >> $GITHUB_OUTPUT | ||
echo "}" >> $GITHUB_OUTPUT | ||
echo "" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
- name: Prepare Develocity Setup 2 | ||
id: develocity_conf_2 | ||
run: | | ||
echo "VALUE<<EOF" >> $GITHUB_OUTPUT | ||
echo "gradleEnterprise {" >> $GITHUB_OUTPUT | ||
echo " server = 'https://ge.grails.org'" >> $GITHUB_OUTPUT | ||
echo " buildScan {" >> $GITHUB_OUTPUT | ||
echo " publishAlways()" >> $GITHUB_OUTPUT | ||
echo " publishIfAuthenticated()" >> $GITHUB_OUTPUT | ||
echo " uploadInBackground = System.getenv('CI') == null" >> $GITHUB_OUTPUT | ||
echo " capture {" >> $GITHUB_OUTPUT | ||
echo " taskInputFiles = true" >> $GITHUB_OUTPUT | ||
echo " }" >> $GITHUB_OUTPUT | ||
echo " }" >> $GITHUB_OUTPUT | ||
echo "}" >> $GITHUB_OUTPUT | ||
echo "" >> $GITHUB_OUTPUT | ||
echo "buildCache {" >> $GITHUB_OUTPUT | ||
echo " local { enabled = System.getenv('CI') != 'true' }" >> $GITHUB_OUTPUT | ||
echo " remote(HttpBuildCache) {" >> $GITHUB_OUTPUT | ||
echo " push = System.getenv('CI') == 'true'" >> $GITHUB_OUTPUT | ||
echo " enabled = true" >> $GITHUB_OUTPUT | ||
echo " url = 'https://ge.grails.org/cache/'" >> $GITHUB_OUTPUT | ||
echo " credentials {" >> $GITHUB_OUTPUT | ||
echo " username = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER')" >> $GITHUB_OUTPUT | ||
echo " password = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')" >> $GITHUB_OUTPUT | ||
echo " }" >> $GITHUB_OUTPUT | ||
echo " }" >> $GITHUB_OUTPUT | ||
echo "}" >> $GITHUB_OUTPUT | ||
echo "" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
- name: Develocity Set-up | ||
run: | | ||
cd ../groovy | ||
# Delete existing plugins from settings.gradle file | ||
sed -i '32,37d' settings.gradle | ||
# Add Gradle Enterprise set-up related configuration after line no 31 in settings.gradle | ||
echo "${{ steps.develocity_conf_1.outputs.value }}" | sed -i -e "31r /dev/stdin" settings.gradle | ||
# Delete existing buildCache configuration from gradle/build-scans.gradle file | ||
sed -i '23,46d' gradle/build-scans.gradle | ||
# Add Gradle Enterprise set-up related configuration after line no 22 in gradle/build-scans.gradle | ||
echo "${{ steps.develocity_conf_2.outputs.value }}" | sed -i -e "22r /dev/stdin" gradle/build-scans.gradle | ||
- name: Build and install groovy (no docs) | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
GRADLE_SCANS_ACCEPT: yes | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
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 }} | ||
with: | ||
build-root-directory: ../groovy | ||
arguments: | | ||
publishToMavenLocal | ||
-x groovydoc | ||
-x javadoc | ||
-x javadocAll | ||
-x groovydocAll | ||
-x asciidoc | ||
-x docGDK | ||
build_project: | ||
needs: [build_groovy] | ||
strategy: | ||
fail-fast: true | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Cache local Maven repository & Groovy | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/groovy | ||
~/.m2/repository | ||
key: cache-local-groovy-maven-${{ github.sha }} | ||
- name: Set CI_GROOVY_VERSION for Grails | ||
run: | | ||
echo "CI_GROOVY_VERSION=${{needs.build_groovy.outputs.groovyVersion}}" >> $GITHUB_ENV | ||
- name: Build GORM | ||
id: build_gorm | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
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 }} | ||
with: | ||
arguments: | | ||
build | ||
-x groovydoc |