[pull] 4.1 from netty:4.1 #693
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
| # ---------------------------------------------------------------------------- | |
| # Copyright 2021 The Netty Project | |
| # | |
| # The Netty Project 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: | |
| # | |
| # https://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 PR | |
| on: | |
| pull_request: | |
| branches: [ "4.1"] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240 | |
| # Cancel running jobs when a new push happens to the same branch as otherwise it will | |
| # tie up too many resources without providing much value. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '8' | |
| # Cache .m2/repository | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| with: | |
| path: ~/.m2/repository | |
| key: cache-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| cache-maven-${{ hashFiles('**/pom.xml') }} | |
| cache-maven- | |
| - name: Verify with Maven | |
| run: ./mvnw -B -ntp --file pom.xml verify -DskipTests=true | |
| - name: Checking bom dependency versions | |
| run: ./.github/scripts/check_bom_dependencies.sh | |
| - name: print JVM thread dumps when cancelled | |
| uses: ./.github/actions/thread-dump-jvms | |
| if: ${{ cancelled() }} | |
| build-pr-windows: | |
| runs-on: windows-2022 | |
| name: windows-x86_64-java11-boringssl | |
| needs: verify-pr | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11' | |
| # Cache .m2/repository | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| with: | |
| path: ~/.m2/repository | |
| key: cache-windows-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| cache-windows-maven-${{ hashFiles('**/pom.xml') }} | |
| cache-windows-maven- | |
| - name: Set up TestLens | |
| uses: testlens-app/setup-testlens@d29a2be31512b3aeda3adcef09fbe0d55af90c51 # Pin 1.9.4 | |
| - name: Build project | |
| run: ./mvnw.cmd -B -ntp --file pom.xml clean package -Pboringssl -DskipHttp2Testsuite=true -DskipAutobahnTestsuite=true | |
| - name: print JVM thread dumps when cancelled | |
| uses: ./.github/actions/thread-dump-jvms | |
| if: ${{ cancelled() }} | |
| - name: Upload Test Results | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-windows-x86_64-java11-boringssl | |
| path: '**/target/surefire-reports/TEST-*.xml' | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ failure() || cancelled() }} | |
| with: | |
| name: build-pr-windows-target | |
| path: | | |
| **/target/surefire-reports/ | |
| **/hs_err*.log | |
| build-pr-cross: | |
| # The host should always be Linux | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: aarch64 | |
| java_arch: arm64 | |
| name: linux-${{ matrix.arch }}-verify-native | |
| permissions: | |
| contents: read # for actions/checkout to fetch code | |
| packages: write # for uraimo/run-on-arch-action to cache docker images | |
| needs: verify-pr | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Cache .m2/repository | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| with: | |
| path: ~/.m2/repository | |
| key: cache-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| cache-maven-${{ hashFiles('**/pom.xml') }} | |
| cache-maven- | |
| - uses: uraimo/run-on-arch-action@v3 | |
| name: Run commands | |
| id: runcmd | |
| with: | |
| arch: ${{ matrix.arch }} | |
| distro: ubuntu20.04 | |
| # Not required, but speeds up builds by storing container images in | |
| # a GitHub package registry. | |
| githubToken: ${{ github.token }} | |
| # Mount the .m2/repository | |
| dockerRunArgs: | | |
| --volume "/home/runner/.m2/repository/:/root/.m2/repository" | |
| # Install dependencies | |
| install: | | |
| apt-get update -q -y | |
| apt-get install -q -y openjdk-11-jdk autoconf automake libtool make tar maven git | |
| # Compile native code and the modules it depend on and run NativeLoadingTest. This is enough to ensure | |
| # we can load the native module on ${{ matrix.arch }} | |
| # | |
| # Use tcnative.classifier that is empty as we don't support using the shared lib version on ubuntu. | |
| run: | | |
| JAVA_HOME=/usr/lib/jvm/java-11-openjdk-${{ matrix.java_arch || matrix.arch }} ./mvnw -V -B -ntp -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier= | |
| build-pr: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - setup: linux-x86_64-java8 | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build" | |
| - setup: linux-x86_64-java11 | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build" | |
| - setup: linux-x86_64-java21-graal | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.graalvm121.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.graalvm121.yaml run build" | |
| - setup: linux-x86_64-java17 | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml run build" | |
| - setup: linux-x86_64-java21 | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.21.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.21.yaml run build-with-oio-testsuite" | |
| - setup: linux-x86_64-java24 | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.24.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.24.yaml run build" | |
| - setup: linux-x86_64-java25 | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.25.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.25.yaml run build" | |
| - setup: linux-x86_64-java11-boringssl | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static" | |
| - setup: linux-x86_64-java11-adaptive | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-adaptive" | |
| - setup: linux-x86_64-java11-awslc | |
| docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml build" | |
| docker-compose-install-tcnative: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run install-tcnative" | |
| docker-compose-update-tcnative-version: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run update-tcnative-version" | |
| docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run build" | |
| name: ${{ matrix.setup }} build | |
| needs: verify-pr | |
| defaults: | |
| run: | |
| working-directory: netty | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: netty | |
| - uses: actions/checkout@v4 | |
| if: ${{ endsWith(matrix.setup, '-awslc') }} | |
| with: | |
| repository: netty/netty-tcnative | |
| ref: main | |
| path: netty-tcnative | |
| fetch-depth: 0 | |
| # Cache .m2/repository | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| if: ${{ !endsWith(matrix.setup, '-awslc') }} | |
| with: | |
| path: ~/.m2/repository | |
| key: cache-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| cache-maven-${{ hashFiles('**/pom.xml') }} | |
| cache-maven- | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| if: ${{ endsWith(matrix.setup, '-awslc') }} | |
| with: | |
| path: ~/.m2-al2023/repository | |
| key: cache-maven-al2023-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| cache-maven-al2023-${{ hashFiles('**/pom.xml') }} | |
| cache-maven-al2023- | |
| - name: Set up TestLens | |
| uses: testlens-app/setup-testlens@d29a2be31512b3aeda3adcef09fbe0d55af90c51 # Pin 1.9.4 | |
| with: | |
| working-directory: netty | |
| - name: Build docker image | |
| run: docker compose ${{ matrix.docker-compose-build }} | |
| - name: Install custom netty-tcnative | |
| if: ${{ endsWith(matrix.setup, '-awslc') }} | |
| run: docker compose ${{ matrix.docker-compose-install-tcnative }} | |
| - name: Update netty-tcnative version | |
| if: ${{ endsWith(matrix.setup, '-awslc') }} | |
| run: docker compose ${{ matrix.docker-compose-update-tcnative-version }} | |
| - name: Build project with leak detection | |
| run: docker compose ${{ matrix.docker-compose-run }} | tee build-leak.output | |
| - name: Checking for test failures | |
| run: ./.github/scripts/check_build_result.sh build-leak.output | |
| - name: Checking for detected leak | |
| run: ./.github/scripts/check_leak.sh build-leak.output | |
| - name: print JVM thread dumps when cancelled | |
| uses: ./netty/.github/actions/thread-dump-jvms | |
| if: ${{ cancelled() }} | |
| - name: Upload Test Results | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.setup }} | |
| path: 'netty/**/target/surefire-reports/TEST-*.xml' | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ failure() || cancelled() }} | |
| with: | |
| name: build-${{ matrix.setup }}-target | |
| path: | | |
| netty/**/target/surefire-reports/ | |
| netty/**/target/autobahntestsuite-reports/ | |
| netty/**/hs_err*.log | |
| netty/**/core.* | |
| build-pr-macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - setup: macos-x86_64-java8-boringssl | |
| os: macos-15-intel | |
| - setup: macos-aarch64-java8-boringssl | |
| os: macos-15 | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.setup }} build | |
| needs: verify-pr | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '8' | |
| # Cache .m2/repository | |
| # Caching of maven dependencies | |
| - uses: actions/cache@v4 | |
| continue-on-error: true | |
| with: | |
| path: ~/.m2/repository | |
| key: cache-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| cache-maven-${{ hashFiles('**/pom.xml') }} | |
| cache-maven- | |
| - name: Install tools via brew | |
| run: brew bundle | |
| - name: Set up TestLens | |
| uses: testlens-app/setup-testlens@d29a2be31512b3aeda3adcef09fbe0d55af90c51 # Pin 1.9.4 | |
| - name: Build project | |
| run: ./mvnw -B -ntp --file pom.xml clean package -Pboringssl -DskipHttp2Testsuite=true -DskipAutobahnTestsuite=true -DskipTests=true | |
| - name: print JVM thread dumps when cancelled | |
| uses: ./.github/actions/thread-dump-jvms | |
| if: ${{ cancelled() }} | |
| - name: Upload Test Results | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.setup }} | |
| path: '**/target/surefire-reports/TEST-*.xml' | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ failure() || cancelled() }} | |
| with: | |
| name: build-pr-${{ matrix.setup }}-target | |
| path: | | |
| **/target/surefire-reports/ | |
| **/hs_err*.log |