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
45 changes: 45 additions & 0 deletions .github/actions/align-serializer-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Align serializer version
description: >-
Computes the branch-suffixed snapshot version for the current branch and, when a
branch of the same name exists in eclipse-serializer/serializer, rewrites the
eclipse.serializer.version POM property to that serializer branch snapshot. This is
the cross-repo coupling used so a store branch builds against its matching serializer
branch. No-op on main / release branches. Requires Maven/JDK to be set up beforehand.

inputs:
github-token:
description: Token used to query branches of the serializer repository.
required: true

outputs:
version:
description: The branch-suffixed snapshot version (e.g. 5.0.0-foo_bar-1a2b3c4d5e-SNAPSHOT).
value: ${{ steps.compute.outputs.version }}
aligned:
description: "'true' if eclipse.serializer.version was rewritten to the serializer branch snapshot."
value: ${{ steps.compute.outputs.aligned }}

runs:
using: composite
steps:
- id: compute
shell: bash
run: |
BRANCH=${GITHUB_REF#refs/heads/}
currentVersion=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
suffix=$(echo -n "$BRANCH" | tr '/' '_' | cut -c1-10)-$(echo -n "$BRANCH" | md5sum | cut -c1-10)
newVersion="${currentVersion%-SNAPSHOT}-${suffix}-SNAPSHOT"
echo "version=$newVersion" >> "$GITHUB_OUTPUT"

aligned=false
if [ "$BRANCH" != "main" ] && [[ "$BRANCH" != release/* ]]; then
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token ${{ inputs.github-token }}" https://api.github.com/repos/eclipse-serializer/serializer/branches/$BRANCH)
if [ "$RESPONSE" -eq 200 ]; then
echo "Matching serializer branch found; aligning eclipse.serializer.version to $newVersion"
mvn versions:set-property -Dproperty=eclipse.serializer.version -DnewVersion=$newVersion --batch-mode
aligned=true
else
echo "No matching serializer branch; keeping default eclipse.serializer.version"
fi
fi
echo "aligned=$aligned" >> "$GITHUB_OUTPUT"
4 changes: 4 additions & 0 deletions .github/workflows/maven_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Align serializer version to matching branch snapshot
uses: ./.github/actions/align-serializer-version
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build with Maven
run: mvn -T 1C -P examples -B clean package --file pom.xml -U

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/maven_build_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Align serializer version to matching branch snapshot
uses: ./.github/actions/align-serializer-version
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build with Maven
run: mvn -T 1C -P examples -B clean package --file pom.xml -U
4 changes: 4 additions & 0 deletions .github/workflows/maven_converter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
- name: Align serializer version to matching branch snapshot
uses: ./.github/actions/align-serializer-version
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build with Maven
run: mvn -B -Pconverter-standalone -pl storage/embedded-tools/storage-converter -am clean package --file pom.xml -U
25 changes: 6 additions & 19 deletions .github/workflows/maven_deploy_snapshot_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,13 @@ jobs:
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Prepare suffix
run: |
suffix=$(echo -n "${GITHUB_REF#refs/heads/}" | tr '/' '_' | cut -c1-10)-$(echo -n "${GITHUB_REF#refs/heads/}" | md5sum | cut -c1-10)
echo "Suffix: $suffix"
echo "SUFFIX=$suffix" >> $GITHUB_ENV
- name: Align serializer version
id: align
uses: ./.github/actions/align-serializer-version
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Update project version
run: |
currentVersion=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
currentVersionWithoutSnapshot=${currentVersion%-SNAPSHOT}
newVersion="${currentVersionWithoutSnapshot}-$SUFFIX-SNAPSHOT"
mvn versions:set -DnewVersion=$newVersion --batch-mode
BRANCH_NAME=${{ github.ref }}
REPO_OWNER="eclipse-serializer"
REPO_NAME="serializer"
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/branches/$BRANCH_NAME)
if [ $RESPONSE -eq 200 ]; then
mvn versions:set-property -Dproperty=eclipse.serializer.version -DnewVersion=$newVersion
else
echo "Branch does not exist in serializer repository, skipping serializer version change"
fi
run: mvn versions:set -DnewVersion=${{ steps.align.outputs.version }} --batch-mode
- name: Make a snapshot
run: mvn -T 1C -Pdeploy -Pproduction --no-transfer-progress --batch-mode clean deploy -U -Dmaven.javadoc.skip=true -Dgpg.skip=true -Dlicense.skip=true -Denforcer.skip=true
env:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/maven_it_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Integration tests (vmt)

permissions:
contents: read
checks: write

on:
push:
branches:
- '**'
pull_request:
branches: [ main ]

jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
#Build with java 17
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Align serializer version to matching branch snapshot
uses: ./.github/actions/align-serializer-version
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build reactor dependencies (no tests)
run: mvn -T 1C -P IT -B clean install -DskipTests -pl integration-tests -am --no-transfer-progress --file pom.xml -U -Dmaven.javadoc.skip=true -Dgpg.skip=true -Dlicense.skip=true -Denforcer.skip=true
- name: Run integration tests
run: mvn -P IT -B test -pl integration-tests --no-transfer-progress --file pom.xml -Dgpg.skip=true -Dlicense.skip=true -Denforcer.skip=true

- name: Report JUnit results (dorny - surefire)
if: always()
uses: dorny/test-reporter@v2
with:
name: "Integration tests (vmt) Results"
path: 'integration-tests/target/surefire-reports/*.xml'
reporter: java-junit
fail-on-error: false
4 changes: 4 additions & 0 deletions .github/workflows/maven_slow_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Align serializer version to matching branch snapshot
uses: ./.github/actions/align-serializer-version
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run slow tests
run: mvn -T 1C -P examples -P slow-tests -B clean test --no-transfer-progress --file pom.xml -U -Dmaven.javadoc.skip=true -Dgpg.skip=true -Dlicense.skip=true -Denforcer.skip=true

Expand Down
Loading
Loading