Skip to content

Commit 17650e0

Browse files
committed
Move CI to GitHub Actions
Closes gh-32449
1 parent 0c17d25 commit 17650e0

13 files changed

+194
-211
lines changed

Diff for: .github/actions/send-notification/action.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Send notification
2+
description: Sends a Google Chat message as a notification of the job's outcome
3+
inputs:
4+
webhook-url:
5+
description: 'Google Chat Webhook URL'
6+
required: true
7+
status:
8+
description: 'Status of the job'
9+
required: true
10+
build-scan-url:
11+
description: 'URL of the build scan to include in the notification'
12+
run-name:
13+
description: 'Name of the run to include in the notification'
14+
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
15+
runs:
16+
using: composite
17+
steps:
18+
- shell: bash
19+
run: |
20+
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
21+
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
22+
- shell: bash
23+
if: ${{ inputs.status == 'success' }}
24+
run: |
25+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
26+
- shell: bash
27+
if: ${{ inputs.status == 'failure' }}
28+
run: |
29+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
30+
- shell: bash
31+
if: ${{ inputs.status == 'cancelled' }}
32+
run: |
33+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true

Diff for: .github/workflows/build-and-deploy-snapshot.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and deploy snapshot
2+
on:
3+
push:
4+
branches:
5+
- 5.3.x
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
jobs:
9+
build-and-deploy-snapshot:
10+
if: ${{ github.repository == 'spring-projects/spring-framework' }}
11+
name: Build and deploy snapshot
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Java
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: 'liberica'
18+
java-version: 8
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
- name: Set up Gradle
22+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
23+
with:
24+
cache-read-only: false
25+
- name: Configure Gradle properties
26+
shell: bash
27+
run: |
28+
mkdir -p $HOME/.gradle
29+
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
30+
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
31+
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
32+
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
33+
- name: Build and publish
34+
id: build
35+
env:
36+
CI: 'true'
37+
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
38+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
39+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
40+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
41+
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
42+
- name: Deploy
43+
uses: spring-io/[email protected]
44+
with:
45+
uri: 'https://repo.spring.io'
46+
username: ${{ secrets.ARTIFACTORY_USERNAME }}
47+
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
48+
build-name: ${{ format('spring-framework-{0}', github.ref_name)}}
49+
repository: 'libs-snapshot-local'
50+
folder: 'deployment-repository'
51+
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
52+
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
53+
artifact-properties: |
54+
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false
55+
/**/framework-api-*-docs.zip::zip.type=docs
56+
/**/framework-api-*-schema.zip::zip.type=schema
57+
- name: Send notification
58+
uses: ./.github/actions/send-notification
59+
if: always()
60+
with:
61+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
62+
status: ${{ job.status }}
63+
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
64+
run-name: ${{ format('{0} | Linux | Java 8', github.ref_name) }}

Diff for: .github/workflows/ci.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- 5.3.x
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
jobs:
9+
ci:
10+
if: ${{ github.repository == 'spring-projects/spring-framework' }}
11+
strategy:
12+
matrix:
13+
os:
14+
- id: ubuntu-latest
15+
name: Linux
16+
java:
17+
- version: 8
18+
toolchain: false
19+
- version: 17
20+
toolchain: true
21+
- version: 21
22+
toolchain: true
23+
exclude:
24+
- os:
25+
name: Linux
26+
java:
27+
version: 8
28+
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
29+
runs-on: ${{ matrix.os.id }}
30+
steps:
31+
- name: Set up Java
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: 'liberica'
35+
java-version: |
36+
${{ matrix.java.version }}
37+
${{ matrix.java.toolchain && '8' || '' }}
38+
- name: Prepare Windows runner
39+
if: ${{ runner.os == 'Windows' }}
40+
run: |
41+
git config --global core.autocrlf true
42+
git config --global core.longPaths true
43+
Stop-Service -name Docker
44+
- name: Check out code
45+
uses: actions/checkout@v4
46+
- name: Set up Gradle
47+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
48+
with:
49+
cache-read-only: false
50+
- name: Configure Gradle properties
51+
shell: bash
52+
run: |
53+
mkdir -p $HOME/.gradle
54+
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
55+
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
56+
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
57+
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
58+
- name: Configure toolchain properties
59+
if: ${{ matrix.java.toolchain }}
60+
shell: bash
61+
run: |
62+
echo toolchainVersion=${{ matrix.java.version }} >> $HOME/.gradle/gradle.properties
63+
echo systemProp.org.gradle.java.installations.auto-detect=false >> $HOME/.gradle/gradle.properties
64+
echo systemProp.org.gradle.java.installations.auto-download=false >> $HOME/.gradle/gradle.properties
65+
echo systemProp.org.gradle.java.installations.paths=${{ format('$JAVA_HOME_{0}_X64', matrix.java.version) }} >> $HOME/.gradle/gradle.properties
66+
- name: Build
67+
id: build
68+
env:
69+
CI: 'true'
70+
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
71+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
72+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
73+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
74+
run: ./gradlew check
75+
- name: Send notification
76+
uses: ./.github/actions/send-notification
77+
if: always()
78+
with:
79+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
80+
status: ${{ job.status }}
81+
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
82+
run-name: ${{ format('{0} | {1} | Java {2}', github.ref_name, matrix.os.name, matrix.java.version) }}

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# <img src="src/docs/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://ci.spring.io/api/v1/teams/spring-framework/pipelines/spring-framework-5.3.x/jobs/build/badge)](https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-5.3.x?groups=Build") [![Revved up by Gradle Enterprise](https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.spring.io/scans?search.rootProjectNames=spring)
1+
# <img src="framework-docs/src/docs/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://github.com/spring-projects/spring-framework/actions/workflows/build-and-deploy-snapshot.yml/badge.svg?branch=5.3.x)](https://github.com/spring-projects/spring-framework/actions/workflows/build-and-deploy-snapshot.yml?query=branch%3A5.3.x) [![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.spring.io/scans?search.rootProjectNames=spring)
22

33
This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
44

Diff for: ci/README.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
== Spring Framework Concourse pipeline
22

3+
NOTE: CI is being migrated to GitHub Actions.
4+
35
The Spring Framework uses https://concourse-ci.org/[Concourse] for its CI build and other automated tasks.
46
The Spring team has a dedicated Concourse instance available at https://ci.spring.io with a build pipeline
57
for https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-5.3.x[Spring Framework 5.3.x].

Diff for: ci/parameters.yml

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ milestone: "5.3.x"
88
build-name: "spring-framework"
99
pipeline-name: "spring-framework"
1010
concourse-url: "https://ci.spring.io"
11-
task-timeout: 1h00m

0 commit comments

Comments
 (0)