Skip to content

Commit

Permalink
ci: setup for 4.x branch (#2433)
Browse files Browse the repository at this point in the history
* ci: setup for 4.x branch

* ci: add timestamps and db env setup

* ci: minor formatting

* ci: add timestamps to integration test output

* ci: fix comment in .github/dependabot.yml

Co-authored-by: Min Zhu <zhumin@google.com>

* ci: remove spring-cloud-dependencies-parent restriction from 4.x dependabot.yml configuration

---------

Co-authored-by: Min Zhu <zhumin@google.com>
  • Loading branch information
burkedavison and zhumin8 committed Dec 12, 2023
1 parent 32b6c26 commit 2d81449
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 101 deletions.
37 changes: 36 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ updates:
versions: ["3.x"]
# Spring Cloud dependencies
- dependency-name: "org.springframework.cloud:spring-cloud-dependencies"
versions: ["2022.x"]
versions: ["2022.x", "2023.x"]
- dependency-name: "org.springframework.cloud:spring-cloud-config"
versions: ["4.x"]
- dependency-name: "org.springframework.cloud:spring-cloud-function"
Expand All @@ -59,3 +59,38 @@ updates:
versions: ["3.x"]
# Spring Native dependencies:
# Will be superseded by Spring Boot 3 official native support

- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
commit-message:
# Prefix all commit messages with "deps: "
prefix: "deps"
open-pull-requests-limit: 10
target-branch: "4.x"
labels:
- "4.x dependencies"
ignore:
# Ignore major version updates - these should be made manually
- dependency-name: "*"
update-types: [ "version-update:semver-major" ]
# Ignore formatter dependency versions used in codegen modules, since they are fixed for Java 8 support
- dependency-name: "com.coveo:fmt-maven-plugin"
- dependency-name: "com.google.googlejavaformat:google-java-format"
# Ignore dependencies corresponding to Spring Boot 3.2+, Spring Cloud 2023.x:
# Spring Boot dependencies
- dependency-name: "org.springframework.boot:spring-boot-dependencies"
versions: [">=3.2.0"]
- dependency-name: "org.springframework.boot:spring-boot-starter-parent"
versions: [">=3.2.0"]
# Spring Cloud dependencies
- dependency-name: "org.springframework.cloud:spring-cloud-dependencies"
versions: ["2023.x"]
- dependency-name: "org.springframework.cloud:spring-cloud-config"
versions: [">=4.1.0"]
- dependency-name: "org.springframework.cloud:spring-cloud-function"
versions: [">=4.1.0"]
# Spring Shell dependencies
- dependency-name: "org.springframework.shell:spring-shell-starter"
versions: [">=3.2.0"]
4 changes: 4 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ branches:
handleGHRelease: true
branch: 3.x
extraFiles: ["README.adoc"]
- releaseType: java-yoshi
handleGHRelease: true
branch: 4.x
extraFiles: ["README.adoc"]
111 changes: 18 additions & 93 deletions .github/workflows/NativeTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,98 +25,31 @@ jobs:
fail-fast: false
matrix:
it:
- bigquery-sample
- core
- vision
- storage
- secretmanager
- logging-sample
- storage-sample
- trace-sample
- vision-sample
- pubsub-sample
- secretmanager-sample
- pubsub-integration-sample
- pubsub-bus-sample
- pubsub-stream-sample
- data-firestore
- data-firestore-sample
- datastore
- starter-firestore-sample
- datastore-basic-sample
- kms
- kms-sample
- bigquery-sample
- logging-sample
- metrics-sample
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d' --utc)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Set Up Authentication
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.SPRING_CLOUD_GCP_CI_NATIVE_SA_KEY }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
with:
project_id: spring-cloud-gcp-ci-native
- name: Mvn install # Need this when the directory/pom structure changes
id: install
run: |
./mvnw \
--batch-mode \
--no-transfer-progress \
--threads 1.5C \
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
install
# Unlike for the other NativeTests job, we don't block here as these run in parallel.
- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.2'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Native Tests in Modules
id: intTest
run: |
MODULE_UNDER_TEST="${{ matrix.it }}" ./.github/workflows/scripts/native-image-tests.sh
- name: Aggregate Report
run: |
./mvnw \
--batch-mode \
--no-transfer-progress \
--define aggregate=true \
--activate-profiles spring-native,\!default \
surefire-report:report-only
- name: Archive logs
if: always()
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: Native Test Logs
path: |
**/target/failsafe-reports/*
**/target/site
NativeTests:
if: |
github.actor != 'dependabot[bot]' && ((
github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name
) || (github.event_name != 'pull_request'))
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
it:
- pubsub-sample
- pubsub-bus-sample
- pubsub-integration-sample
- pubsub-stream-sample
- secretmanager
- secretmanager-sample
- spanner
- datastore-basic-sample
- data-firestore-sample
- data-firestore
- sql-mysql-sample
- sql-postgres-sample
- starter-firestore-sample
- storage
- storage-sample
- trace-sample
- vision
- vision-sample
steps:
- name: Get current date
id: date
Expand Down Expand Up @@ -144,13 +77,6 @@ jobs:
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
install
- name: Wait our turn for running native tests
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
continue-after-seconds: 3600 # 60 min
same-branch-only: false
- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.2'
Expand All @@ -160,10 +86,9 @@ jobs:
native-image-job-reports: 'true'
- name: Native Tests in Modules
id: intTest
run: |
MODULE_UNDER_TEST="${{ matrix.it }}" ./.github/workflows/scripts/native-image-tests.sh
env:
DB_PASSWORD: ${{ secrets.SPRING_CLOUD_GCP_CI_NATIVE_DB_ROOT_PASSWORD }}
run: MODULE_UNDER_TEST="${{ matrix.it }}" ./.github/workflows/scripts/native-image-tests.sh
- name: Aggregate Report
run: |
./mvnw \
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- 3.x
- 4.x
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
Expand Down Expand Up @@ -68,6 +69,8 @@ jobs:
--threads 1.5C \
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
install
# Unlike for the other integrationTest job, we don't block here as these run in parallel.
- name: Integration Tests
Expand All @@ -79,6 +82,8 @@ jobs:
--activate-profiles spring-cloud-gcp-ci-it \
--define maven.javadoc.skip=true \
--define skip.surefire.tests=true \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
--define "spring.datasource.password=${DB_PASSWORD}" \
--define "spring.r2dbc.password=${DB_PASSWORD}" \
--define it.${{ matrix.it }}=true \
Expand Down Expand Up @@ -151,6 +156,8 @@ jobs:
--threads 1.5C \
--define maven.test.skip=true \
--define maven.javadoc.skip=true \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
install
- name: Wait our turn for running integration tests
uses: softprops/turnstyle@v1
Expand All @@ -168,6 +175,8 @@ jobs:
--activate-profiles spring-cloud-gcp-ci-it \
--define maven.javadoc.skip=true \
--define skip.surefire.tests=true \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
--define "spring.datasource.password=${DB_PASSWORD}" \
--define "spring.r2dbc.password=${DB_PASSWORD}" \
--define it.${{ matrix.it }}=true \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
- name: Run Renovate
uses: renovatebot/forking-renovate@main
with:
baseBranches: main,3.x
baseBranches: main,3.x,4.x
createPullRequests: true
35 changes: 30 additions & 5 deletions .github/workflows/scripts/native-image-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,36 @@ run_sample_tests () {
fi
done
pushd spring-cloud-gcp-pubsub-stream-functional-sample/spring-cloud-gcp-pubsub-stream-functional-sample-test
mvn package -Pnative -Pnative-sample-config -DskipTests
mvn -Pnative-sample-config -PnativeTest --define notAllModules=true --define maven.javadoc.skip=true test
mvn package \
-Pnative -Pnative-sample-config \
--define skipTests \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
mvn test \
-Pnative-sample-config -PnativeTest \
--define notAllModules=true \
--define maven.javadoc.skip=true \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
popd
filtered_project_names="$(echo "${filtered_modules[@]}" | sed 's/ /,/g')"
mvn clean --activate-profiles native-sample-config,nativeTest --define notAllModules=true --define maven.javadoc.skip=true -pl="${filtered_project_names}" test
mvn clean test \
--activate-profiles native-sample-config,nativeTest \
--define notAllModules=true \
--define maven.javadoc.skip=true \
-pl="${filtered_project_names}" \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS

else
project_names="$(echo "${module_samples[@]}" | sed 's/ /,/g')"
mvn clean --activate-profiles native-sample-config,nativeTest --define notAllModules=true --define maven.javadoc.skip=true -pl="${project_names}" test
mvn clean test \
--activate-profiles native-sample-config,nativeTest \
--define notAllModules=true \
--define maven.javadoc.skip=true \
-pl="${project_names}" \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
fi
popd
}
Expand All @@ -74,7 +95,11 @@ run_module_tests() {
fi
done
project_names="$(echo "${module_samples[@]}" | sed 's/ /,/g')"
mvn clean verify -Pspring-native,!default -pl="${project_names}"
mvn clean verify \
-Pspring-native,!default \
-pl="${project_names}" \
--define org.slf4j.simpleLogger.showDateTime=true \
--define org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
}


Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- 3.x
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unitTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- 3.x
- 4.x
pull_request:
workflow_dispatch:
schedule:
Expand Down

0 comments on commit 2d81449

Please sign in to comment.