diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8718e751..48a71129 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -24,7 +24,7 @@ jobs: env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} with: - arguments: build -x test -x integrationTest + arguments: build publish_documentation: name: Publish Snapshot release runs-on: ubuntu-latest diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml new file mode 100644 index 00000000..9e72bd75 --- /dev/null +++ b/.github/workflows/groovy-joint-workflow.yml @@ -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<> $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<> $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 \ No newline at end of file