You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2021/12/24 10:09:59 UTC
[logging-log4j2] branch release-2.x updated: Simplify GitHub Actions workflow.
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
The following commit(s) were added to refs/heads/release-2.x by this push:
new 124ca65 Simplify GitHub Actions workflow.
124ca65 is described below
commit 124ca6501953619f9b2e0b19a7eba3423ea0281b
Author: Volkan Yazici <vo...@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..aee36c4
--- /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'