Repository navigation
test(spring-boot): [Sample Tests 25] Move the Boot 4 OTel agent sample's tests #5581
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Spring Boot 4.x Matrix | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| paths-ignore: | |
| - '*android*/**' | |
| - 'sentry-compose/**' | |
| - 'sentry-samples/sentry-samples-android/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| spring-boot-4-matrix: | |
| timeout-minutes: 45 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| springboot-version: [ '4.0.0', '4.0.5', '4.1.0' ] | |
| name: Spring Boot ${{ matrix.springboot-version }} | |
| env: | |
| SENTRY_URL: http://127.0.0.1:8000 | |
| GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: 'recursive' | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: '3.10.5' | |
| - name: Install Python dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install -r requirements.txt | |
| - name: Set up Java | |
| uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| # Workaround for https://github.com/gradle/actions/issues/21 to use config cache | |
| - name: Cache buildSrc | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: buildSrc/build | |
| key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Update Spring Boot 4.x version | |
| run: | | |
| springboot_version="${{ matrix.springboot-version }}" | |
| perl -0pi -e 'BEGIN { $v = shift } s/^springboot4[[:space:]]*=[[:space:]]*"\K[^"]*/$v/m or die "::error::springboot4 version entry not found in gradle/libs.versions.toml\n"' "$springboot_version" gradle/libs.versions.toml | |
| echo "Updated Spring Boot 4.x version to $springboot_version" | |
| - name: Build sample artifacts | |
| run: | | |
| ./gradlew \ | |
| :sentry-samples:sentry-samples-spring-7:war \ | |
| :sentry-samples:sentry-samples-spring-7:testClasses | |
| - name: Test sentry-spring-boot-4 integration suites | |
| run: | | |
| ./gradlew \ | |
| :sentry-spring-boot-4:integrationTest \ | |
| :sentry-spring-boot-4:integrationTestWebflux \ | |
| :sentry-spring-boot-4:integrationTestOtelNoAgent \ | |
| :sentry-spring-boot-4:integrationTestLog4j2 \ | |
| :sentry-spring-boot-4:integrationTestOtelAgent \ | |
| :sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit | |
| - name: Run sentry-samples-spring-7 | |
| run: | | |
| python3 test/system-test-runner.py test \ | |
| --module "sentry-samples-spring-7" \ | |
| --agent false \ | |
| --auto-init "true" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | |
| with: | |
| name: test-results-springboot-4-${{ matrix.springboot-version }} | |
| path: | | |
| **/build/reports/* | |
| **/build/test-results/**/*.xml | |
| sentry-mock-server.txt | |
| spring-server.txt | |
| - name: Test Report | |
| uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16 | |
| if: always() | |
| with: | |
| name: JUnit Spring Boot 4.x ${{ matrix.springboot-version }} | |
| path: | | |
| **/build/test-results/**/*.xml | |
| reporter: java-junit | |
| output-to: step-summary | |
| fail-on-error: false |