From 9032e860689a11715b9fa36cd32cb7d0cf2fbbd1 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Wed, 13 Sep 2023 18:16:52 -0400 Subject: [PATCH] Adding ci-pr.yml (#2808) * Adding ci-pr.yml * Add missing settings.xml * [CI] Polish ci-pr.yml - Remove extra profiles from settings.xml - Simpify the workflow --------- Co-authored-by: Chris Bono --- .github/settings.xml | 62 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci-pr.yml | 59 +++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 .github/settings.xml create mode 100644 .github/workflows/ci-pr.yml diff --git a/.github/settings.xml b/.github/settings.xml new file mode 100644 index 000000000..f328599b4 --- /dev/null +++ b/.github/settings.xml @@ -0,0 +1,62 @@ + + + + pr + + true + + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + maven-central + Maven Central + https://repo.maven.apache.org/maven2 + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 000000000..f5145be83 --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,59 @@ +name: CI PRs + +on: + pull_request: + branches: + - 'main' + - '4.0.x' + - '3.2.x' + paths-ignore: + - '.github/**' + +env: + MAVEN_THREADS: '-T 2' + +jobs: + build_and_verify: + name: Build and Verify + if: github.repository == 'spring-cloud/spring-cloud-stream' + runs-on: ubuntu-latest + steps: + + - name: Checkout SCSt repo + uses: actions/checkout@v2 + + - name: Setup Maven cache + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- + + - name: Setup Java 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'liberica' + + - name: Setup Maven + uses: jvalkeal/setup-maven@v1 + with: + maven-version: 3.8.8 + maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/' + + - name: Build and run unit tests + run: | + mvn -B -s .github/settings.xml clean install + + - name: Clean Maven cache + run: | + find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr + + - name: Capture Test Results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: test-results + path: '*/target/surefire-reports/*.*' + retention-days: 3