Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .github/workflows/android-reusable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ on:
workflow_call:
inputs:
log4j-version:
description: 'Log4j version'
required: true
description: Version of Log4j Core
type: string
# Should point to the current 2.x snapshot version
default: 2.25.0-SNAPSHOT
log4j-repository-url:
description: Additional Maven repository
type: string
default: 'https://repository.apache.org/snapshots'

permissions: read-all

Expand All @@ -46,6 +51,12 @@ jobs:

- name: Setup Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # 4.1.0
with:
develocity-access-key: ${{ secrets.GE_ACCESS_KEY }}
develocity-injection-enabled: true
develocity-url: https://ge.apache.org
develocity-plugin-version: 3.18.1


- name: Enable KVM
run: |
Expand All @@ -56,10 +67,17 @@ jobs:
- name: Create AVD Device
id: avd
shell: bash
env:
ANDROID_SDK_VERSION: 10406996
ANDROID_SDK_CHECKSUM: 8919e8752979db73d8321e9babe2caedcc393750817c1a5f56c128ec442fb540
run: |
# Debug environment variables
printenv | grep '^ANDROID\|^HOME' | sort

# Set `ANDROID_USER_HOME` since `emulator` and `avdmanager` use different definitions:
# * `avdmanager` uses `$XDG_CONFIG_HOME/.android` with a fallback to `$HOME/.android`:
# https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:common/src/main/java/com/android/prefs/AbstractAndroidLocations.kt
# * `emulator` uses `HOME/.android`
export ANDROID_USER_HOME="$HOME/.android"
echo "ANDROID_USER_HOME=$ANDROID_USER_HOME" >> $GITHUB_ENV

# List installed and available packages
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list
# Download images
Expand All @@ -71,6 +89,7 @@ jobs:
--name generic-api-31-device \
--device "5.4in FWVGA" \
--package "system-images;android-31;default;x86_64"
$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list avds
# Run emulator
$ANDROID_HOME/emulator/emulator \
-no-audio -no-window \
Expand All @@ -91,10 +110,12 @@ jobs:
shell: bash
env:
LOG4J_VERSION: ${{ inputs.log4j-version }}
LOG4J_REPOSITORY_URL: ${{ inputs.log4j-repository-url }}
run: |
log4j-samples-android/gradlew -p log4j-samples-android \
--console plain \
-Plog4j.version=$LOG4J_VERSION \
-Plog4j.repository.url=$LOG4J_REPOSITORY_URL \
build connectedCheck

- name: Remove AVD Device
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/android-test.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ on:
- "**.adoc"
- "**.md"
- "**.txt"
schedule:
- cron: "29 17 * * *"

permissions: read-all

jobs:

build:
integration-test:
if: github.actor != 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.3.0
with:
java-version: 21
uses: apache/logging-log4j-samples/.github/workflows/integration-test.yaml@main
16 changes: 9 additions & 7 deletions .github/workflows/graalvm-reusable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ name: graalvm-reusable-test
on:
workflow_call:
inputs:
backend:
description: 'Logging backend'
required: true
type: string
log4j-version:
description: 'Log4j version'
required: true
description: Version of Log4j Core
type: string
# Should point to the current 2.x snapshot version
default: 2.25.0-SNAPSHOT
log4j-repository-url:
description: Additional Maven repository
type: string
default: 'https://repository.apache.org/snapshots'

permissions: read-all

Expand All @@ -40,6 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
backend: [ jul, log4j-core-minimal, log4j-core-jtl, log4j-core, logback, simple]
os: [ macos-latest, ubuntu-latest, windows-latest ]

steps:
Expand All @@ -57,7 +59,7 @@ jobs:
shell: bash
env:
LOG4J_VERSION: ${{ inputs.log4j-version }}
MAVEN_PROFILE: use-${{ inputs.backend }}
MAVEN_PROFILE: use-${{ matrix.backend }}
run: |
./mvnw -f log4j-samples-graalvm \
--show-version --batch-mode --errors --no-transfer-progress \
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/graalvm-test.yaml

This file was deleted.

23 changes: 17 additions & 6 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
name: integration-test

on:
workflow_call:
inputs:
log4j-version:
description: Version of Log4j Core
type: string
# Should point to the current 2.x snapshot version
default: 2.25.0-SNAPSHOT
log4j-repository-url:
description: Additional Maven repository
type: string
default: 'https://repository.apache.org/snapshots'
workflow_dispatch:
inputs:
log4j-version:
Expand All @@ -36,21 +47,21 @@ permissions: read-all
jobs:

jre-test:
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@feature/maven-args
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@main
with:
java-version: 21
maven-args: |
-Dlog4j.version=${{log4j-version}}
-Dlog4j.repository.url=${{log4j-repository-url}}
-Dlog4j.version=${{ inputs.log4j-version }}
-Dlog4j.repository.url=${{ inputs.log4j-repository-url }}

android-test:
uses: apache/logging-log4j-samples/.github/workflows/android-reusable-test.yaml@feature/integrated-tests
uses: apache/logging-log4j-samples/.github/workflows/android-reusable-test.yaml@main
with:
log4j-version: ${{ inputs.log4j-version }}
log4j-repository-url: ${{ inputs.log4j-repository-url }}

graalvm-test:
uses: apache/logging-log4j-samples/.github/workflows/graalvm-reusable-test.yaml@feature/integrated-tests
uses: apache/logging-log4j-samples/.github/workflows/graalvm-reusable-test.yaml@main
with:
log4j-version: ${{ inputs.log4j-version }}
log4j-repository-url: ${{ inputs.log4j-repository-url }}
log4j-repository-url: ${{ inputs.log4j-repository-url }}
10 changes: 7 additions & 3 deletions .github/workflows/merge-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ permissions: read-all

jobs:

build:
integration-test:
if: github.repository == 'apache/logging-log4j-samples' && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.3.0
uses: apache/logging-log4j-samples/.github/workflows/integration-test.yaml@main
with:
java-version: 21

merge-dependabot:
needs: build
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@rel/11.3.0
uses: apache/logging-parent/.github/workflows/merge-dependabot-reusable.yaml@main
permissions:
contents: write # to push changelog commits
pull-requests: write # to close the PR
secrets:
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }} # to sign commits
with:
maven-args: |
-Dlog4j.version=${{ inputs.log4j-version }}
-Dlog4j.repository.url=${{ inputs.log4j-repository-url }}
5 changes: 3 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
8 changes: 4 additions & 4 deletions log4j-samples-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
android.useAndroidX = true

##
# Version of Log4j to use
# Version of Log4j Core
#
# Defaults to the last stable 2.x release
# Default: last stable 2.x release
log4j.version = 2.24.1

##
# Additional Maven Repository to use
# Additional Maven repository
#
# Defaults to Apache Snapshots Repository
# Default: Apache Snapshots Repository
log4j.repository.url = https://repository.apache.org/snapshots
33 changes: 19 additions & 14 deletions log4j-samples-graalvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@
<name>Apache Log4j Samples: GraalVM native image</name>

<properties>
<!--
~ Version of Log4j Core
~
~ Set to latest stable 2.x release for users.
~ Our workflows override this.
-->
<log4j.version>2.24.1</log4j.version>
<!--
~ Additional Maven repository
~
~ Default: Apache Snapshots Repository
~ Our workflows override this.
-->
<log4j.repository.url>https://repository.apache.org/snapshots</log4j.repository.url>

<!-- Some samples require JDK 9+ -->
<minimalJavaBuildVersion>17</minimalJavaBuildVersion>
<maven.compiler.release>17</maven.compiler.release>
Expand Down Expand Up @@ -133,21 +148,11 @@

<repositories>

<!-- The repository that contains the requested Log4j version -->
<repository>
<releases>
<enabled>false</enabled>
</releases>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/snapshots</url>
</repository>

<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>apache.staging</id>
<url>https://repository.apache.org/content/repositories/orgapachelogging-1303</url>
<id>log4j</id>
<name>Log4j Maven Repository</name>
<url>${log4j.repository.url}</url>
</repository>

</repositories>
Expand Down
Loading
Loading