This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch release-2.x in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 8544b115db1a3d6cb1184430295fb90313abc0e8 Author: Volkan Yazici <vol...@yazi.ci> AuthorDate: Fri Dec 24 11:05:22 2021 +0100 Simplify GitHub Actions workflow. --- .github/workflows/benchmark.yml | 1 + .github/workflows/build.yml | 78 ++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 98 ----------------------------------------- 3 files changed, 79 insertions(+), 98 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7b55c9c..b441caf 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,6 +31,7 @@ jobs: uses: actions/checkout@v2 # JDK 11 is needed for the build. + # Search `maven-toolchains-plugin` usages for details. - name: Set up JDK 11 uses: actions/setup-java@v2.4.0 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..08a2da0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,78 @@ +# 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, pull_request ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + + steps: + + - name: Checkout repository + uses: actions/checkout@v2 + + # JDK 11 is needed for the build. + # Search `maven-toolchains-plugin` usages for details. + - name: Setup JDK 11 + uses: actions/setup-java@v2.4.0 + with: + distribution: temurin + java-version: 11 + java-package: jdk + architecture: x64 + cache: maven + + # JDK 8 is needed for the build, and it is the primary bytecode target. + # Hence, JDK 8 is set up after 11, so that JAVA_HOME used by Maven during build will point to 8. + - name: Setup JDK 8 + uses: actions/setup-java@v2.3.0 + with: + distribution: temurin + java-version: 8 + java-package: jdk + architecture: x64 + cache: maven + + - name: Inspect environment (Linux) + if: runner.os == 'Linux' + run: env | grep '^JAVA' + + - name: Inspect environment (Windows) + if: runner.os == 'Windows' + run: set java + + - name: Inspect environment (MacOS) + if: runner.os == 'macOS' + run: env | grep '^JAVA' + + - name: Build with Maven + timeout-minutes: 60 + shell: bash + run: | + ./mvnw \ + --show-version --batch-mode --errors --no-transfer-progress \ + -DtrimStackTrace=false \ + -Dsurefire.rerunFailingTestsCount=2 \ + -Dlog4j2.junit.fileCleanerSleepPeriodMillis=1000 \ + --global-toolchains ".github/workflows/maven-toolchains.xml" \ + verify diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 7697112..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,98 +0,0 @@ -# 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: CI - -on: [push, pull_request] - -jobs: - build: - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Setup JDK 11 - uses: actions/setup-java@v2.4.0 - with: - distribution: 'temurin' - java-version: 11 - java-package: jdk - architecture: x64 - - - name: Setup JDK 8 - uses: actions/setup-java@v2.3.0 - with: - distribution: 'temurin' - java-version: 8 - java-package: jdk - architecture: x64 - cache: 'maven' - - - name: Inspect environment (Linux) - if: runner.os == 'Linux' - run: env | grep '^JAVA' - - - name: Build with Maven (Linux) - timeout-minutes: 60 - if: runner.os == 'Linux' - continue-on-error: true - run: ./mvnw -V -B --no-transfer-progress -e -DtrimStackTrace=false -Dmaven.test.failure.ignore=true -Dsurefire.rerunFailingTestsCount=1 --global-toolchains .github/workflows/maven-toolchains.xml verify - - - name: Inspect environment (Windows) - if: runner.os == 'Windows' - run: set java - - - name: Build with Maven (Windows) - timeout-minutes: 60 - if: runner.os == 'Windows' - continue-on-error: true - run: ./mvnw -V -B --no-transfer-progress -e "-DtrimStackTrace=false" "-Dmaven.test.failure.ignore=true" "-Dsurefire.rerunFailingTestsCount=1" "-Dlog4j2.junit.fileCleanerSleepPeriodMillis=1000" --global-toolchains ".github\workflows\maven-toolchains.xml" verify - - - name: Inspect environment (MacOS) - if: runner.os == 'macOS' - run: env | grep '^JAVA' - - - name: Build with Maven (MacOS) - timeout-minutes: 60 - if: runner.os == 'macOS' - continue-on-error: true - run: ./mvnw -V -B --no-transfer-progress -e -DtrimStackTrace=false -Dmaven.test.failure.ignore=true -Dsurefire.rerunFailingTestsCount=1 --global-toolchains .github/workflows/maven-toolchains.xml verify - - - name: Publish Test Results - # If the CI run is not initiated from the primary repository, it is highly likely that this is a PR from a user who doesn't have commit rights. - # Hence, skip this step to avoid permission failures. - if: github.repository == 'apache/logging-log4j2' - uses: scacap/action-surefire-report@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - check_name: Test Report (${{ matrix.os }}) - report_paths: '**/*-reports/TEST-*.xml' - - - name: Upload Test Reports - # If the CI run is not initiated from the primary repository, it is highly likely that this is a PR from a user who doesn't have commit rights. - # Hence, skip this step to avoid permission failures. - if: github.repository == 'apache/logging-log4j2' - uses: actions/upload-artifact@v2 - with: - name: test-reports-${{ matrix.os }} - path: '**/*-reports'