test: add TCC mode integration tests #14702
Workflow file for this run
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
| # | |
| # Licensed to the Apache Software Foundation (ASF) under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # The ASF licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| name: "build" | |
| on: | |
| push: | |
| branches: [ 2.x, develop, master ] | |
| pull_request: | |
| branches: [ 2.x, develop, master ] | |
| types: [opened, reopened, synchronize] | |
| paths-ignore: | |
| - '**.md' | |
| jobs: | |
| # job 1: Test based on java 8, 17, 21 and 25. | |
| build: | |
| name: "build" | |
| services: | |
| redis: | |
| image: redis:7.2 | |
| ports: | |
| - 6379:6379 | |
| options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| nacos: | |
| image: nacos/nacos-server:v2.4.2 | |
| ports: | |
| - 8848:8848 | |
| env: | |
| MODE: standalone | |
| SPRING_SECURITY_ENABLED: false | |
| options: --health-cmd="curl -f http://localhost:8848/nacos" --health-interval=10s --health-timeout=5s --health-retries=3 --health-start-period=30s | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ 8, 17, 21, 25 ] | |
| steps: | |
| # step 1 | |
| - name: "Checkout" | |
| uses: actions/checkout@v3 | |
| # step 2 | |
| - name: "Use Python 3.x" | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| # step 3 | |
| - name: "Set up Java JDK" | |
| uses: actions/[email protected] | |
| with: | |
| distribution: 'zulu' | |
| java-version: ${{ matrix.java }} | |
| # step 4 | |
| - name: "Print maven version" | |
| run: ./mvnw -version | |
| # step 5 | |
| - name: "Restore local maven repository cache" | |
| uses: actions/cache/restore@v4 | |
| id: cache-maven-repository | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| ${{ runner.os }}-maven- | |
| # step 6.1 | |
| - name: "Test, Check PMD, Check license with Maven and Java8" | |
| if: matrix.java == '8' | |
| run: | | |
| ./mvnw -T 4C clean test \ | |
| -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true -DnacosCaseEnabled=true \ | |
| -e -B \ | |
| -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ | |
| -Dorg.slf4j.simpleLogger.log.net.sourceforge.pmd=info \ | |
| 2>&1 | tee build.log | while read line; do | |
| echo "$line" | |
| if [[ "$line" == *"PMD Failure"* ]]; then | |
| echo "::error::PMD Violations Detected! Check Details Above!" | |
| fi | |
| done | |
| exit_code=${PIPESTATUS[0]} | |
| exit $exit_code | |
| # step 6.2 | |
| - name: "Test with Maven and Java${{ matrix.java }}" | |
| if: matrix.java != '8' | |
| run: | | |
| ./mvnw -T 4C clean test \ | |
| -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn; | |
| # step 7 | |
| - name: "Save local maven repository cache" | |
| uses: actions/cache/save@v4 | |
| if: steps.cache-maven-repository.outputs.cache-hit != 'true' | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.TODAY }} | |
| # step 8 | |
| - name: "Codecov" | |
| if: matrix.java == '8' | |
| uses: codecov/[email protected] | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| version: v0.6.0 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| # job 2: Build and Release on 'arm64v8/ubuntu' OS (Skip tests). | |
| build_arm64-binary: | |
| runs-on: ubuntu-24.04-arm | |
| if: ${{ github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'snapshot' || github.ref_name == '2.x') }} | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| # step 1 | |
| - name: "Checkout" | |
| uses: actions/checkout@v3 | |
| # step 2 | |
| - name: "Set up Java JDK 25" | |
| uses: actions/[email protected] | |
| with: | |
| distribution: 'zulu' | |
| java-version: 25 | |
| # step 4 | |
| - name: "Print maven version" | |
| run: ./mvnw -version | |
| # step 3 | |
| - name: "Build with Maven on 'ubuntu:24.04-arm' OS (Skip tests)" | |
| run: | | |
| ./mvnw -T 4C clean install \ | |
| -Prelease-seata \ | |
| -DskipTests \ | |
| -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn |