Skip to content

Commit

Permalink
Migrate CI/CD to GHA
Browse files Browse the repository at this point in the history
* Upgrade to Gradle `8.4` and latest plugins for Develocity (formerly Gradle Enterprise)
* Add GHA workflows based on a common repository with reusable workflows
* Remove `release-files-spec.json` as it is supplied by common repo on respective CI/CD phase
* Remove obsolete GHA workflows
* Fix deprecation in the `AbstractTestContainerTests`
* Fix `rawtypes` warning in the `SimpleMessageListenerContainerIntegration2Tests`
  • Loading branch information
artembilan committed Nov 28, 2023
1 parent 6ea4305 commit bbeed2e
Show file tree
Hide file tree
Showing 17 changed files with 125 additions and 238 deletions.
31 changes: 0 additions & 31 deletions .github/release-files-spec.json

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/central-sync-close.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/central-sync-create.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/central-sync-release.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/ci-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI SNAPSHOT

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build-snapshot:
uses: artembilan/spring-github-workflows/.github/workflows/spring-artifactory-gradle-snapshot.yml@main
secrets:
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
38 changes: 0 additions & 38 deletions .github/workflows/pr-build-workflow.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Pull Request Build

on:
pull_request:
branches:
- main

jobs:
build-pull-request:
uses: artembilan/spring-github-workflows/.github/workflows/spring-gradle-pull-request-build.yml@main
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
workflow_dispatch:

run-name: Release current version for branch ${{ github.ref_name }}

jobs:
release:
uses: artembilan/spring-github-workflows/.github/workflows/spring-artifactory-release.yml@main
secrets:
GH_ACTIONS_REPO_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
OSSRH_URL: ${{ secrets.OSSRH_URL }}
OSSRH_S01_TOKEN_USERNAME: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
OSSRH_S01_TOKEN_PASSWORD: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
OSSRH_STAGING_PROFILE_NAME: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
SPRING_RELEASE_SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
47 changes: 47 additions & 0 deletions .github/workflows/verify-staged-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Verify Staged Artifacts

on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version like 5.0.0-M1, 5.1.0-RC1, 5.2.0 etc.'
required: true
type: string

jobs:
verify-staged-with-samples:
runs-on: ubuntu-latest
steps:

- name: Checkout Samples Repo
uses: actions/checkout@v4
with:
repository: spring-projects/spring-amqp-samples
show-progress: false

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: 'maven'

- uses: jfrog/setup-jfrog-cli@v3
- name: Configure JFrog Cli
run: |
jf mvnc \
--repo-resolve-releases=libs-staging-local \
--repo-resolve-snapshots=snapshot \
--repo-deploy-releases=libs-milestone-local \
--repo-deploy-snapshots=libs-snapshot-local
- name: Verify samples against staged release
run: jf mvn verify -D"spring.amqp.version"=${{ inputs.releaseVersion }}

- name: Capture Test Results
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: '**/target/surefire-reports/**/*.*'
retention-days: 1
44 changes: 3 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlinVersion = '1.9.10'
ext.isCI = System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey')
ext.isCI = System.getenv('GITHUB_ACTION')
repositories {
mavenCentral()
gradlePluginPortal()
Expand All @@ -19,11 +19,9 @@ plugins {
id 'base'
id 'project-report'
id 'idea'
id 'org.sonarqube' version '4.3.0.3225'
id 'org.ajoberstar.grgit' version '4.0.1'
id 'org.ajoberstar.grgit' version '4.1.1'
id 'io.spring.nohttp' version '0.0.11'
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'com.jfrog.artifactory' version '4.33.1' apply false
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
}
Expand Down Expand Up @@ -135,7 +133,6 @@ configure(javaProjects) { subproject ->
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
Expand Down Expand Up @@ -168,10 +165,6 @@ configure(javaProjects) { subproject ->
}
}

jacoco {
toolVersion = '0.8.10'
}

// dependencies that are common across all java projects
dependencies {
compileOnly "com.google.code.findbugs:jsr305:$googleJsr305Version"
Expand Down Expand Up @@ -279,25 +272,8 @@ configure(javaProjects) { subproject ->
showStackTraces = true
exceptionFormat = 'full'
}

jacoco {
destinationFile = file("$buildDir/jacoco.exec")
}

}

jacocoTestReport {
onlyIf { System.properties['sonar.host.url'] }
dependsOn test
reports {
xml.required = true
csv.required = false
html.required = false
}
}

rootProject.tasks['sonarqube'].dependsOn jacocoTestReport

task testAll(type: Test, dependsOn: check)

gradle.taskGraph.whenReady { graph ->
Expand Down Expand Up @@ -402,10 +378,6 @@ project('spring-amqp-bom') {
}
}
}

sonarqube {
skipProject = true
}
}

project('spring-rabbit') {
Expand Down Expand Up @@ -644,16 +616,6 @@ task reference(dependsOn: asciidoctor) {
description = 'Generate the reference documentation'
}

sonarqube {
properties {
property 'sonar.links.homepage', linkHomepage
property 'sonar.links.ci', linkCi
property 'sonar.links.issue', linkIssue
property 'sonar.links.scm', linkScmUrl
property 'sonar.links.scm_dev', linkScmDevConnection
}
}

task api(type: Javadoc) {
group = 'Documentation'
description = 'Generates aggregated Javadoc API documentation.'
Expand Down
6 changes: 0 additions & 6 deletions gradle/publish-maven.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'

publishing {
publications {
Expand Down Expand Up @@ -80,8 +79,3 @@ publishing {
}
}
}

artifactoryPublish {
dependsOn build
publications(publishing.publications.mavenJava)
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading

0 comments on commit bbeed2e

Please sign in to comment.