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
62 changes: 16 additions & 46 deletions .github/workflows/junit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
# Therefore to really test a change to this script, push it to your fork's master branch
# and then create a PR against your own master branch.

# You can run this locally to test changes with the act command https://nektosact.com/
# Steps:
# 1. Get a PAT (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
# Use fine grained one, needs Read access to artifact metadata, and metadata
# 2. Get the URL of some artifacts to test against from a previous run of the build
# script (such as your last run on your fork's master branch). It looks like:
# https://api.github.com/repos/jonahgraham/eclipse.platform.swt/actions/runs/19980765555/artifacts
# 3. Run the act command:
# act -W '.github/workflows/junit.yml' -s GITHUB_TOKEN=your_token --input artifacts_url=your_url

name: Publish Unit Test Results

on:
Expand All @@ -29,47 +19,42 @@ permissions:

jobs:
discover-results:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
if: github.event.workflow_run.conclusion != 'skipped'
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
isall: ${{ steps.build-matrix.outputs.isall }}
steps:
- name: Find test-results from artifacts_url and build dynamic matrix
- name: Search test-results and build dynamic matrix
id: build-matrix
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
set -x
# Get the URL from the event, or the act command line
artifacts_url=${{ github.event.workflow_run.artifacts_url || github.event.inputs.artifacts_url }}
results=$(gh api "$artifacts_url" -q '.artifacts[] | [.name] | @tsv' | grep 'test-results-')
# Get the URL from the event
results=$(gh api -H "X-GitHub-Api-Version: 2026-03-10" \
'repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts' \
--jq '.artifacts[].name | select(startswith("test-result"))')

platforms=""
if [[ "$results" == *macos* ]]; then
platforms="macos"
if [[ "$results" == *macosx* ]]; then
platforms="macosx"
fi
if [[ "$results" == *linux* ]]; then
if [[ -n "$platforms" ]]; then
platforms+=" "
fi
platforms+="linux"
platforms+=" linux"
fi
if [[ "$results" == *win32* ]]; then
if [[ -n "$platforms" ]]; then
platforms+=" "
fi
platforms+="win32"
platforms+=" win32"
fi

if [[ "$platforms" == "macos linux win32" ]]; then
platforms="${platforms# }"
if [[ "$platforms" == "macosx linux win32" ]]; then
platforms+=" all"
echo "isall=1" >> "$GITHUB_OUTPUT"
else
echo "isall=0" >> "$GITHUB_OUTPUT"
fi

json=$(jq -R --arg key "platform" 'split(" ") | {($key): .}' <<< "$platforms")
json=$(jq --raw-input --arg key "platform" 'split(" ") | {($key): .}' <<< "$platforms")

echo "Matrix JSON (pretty): ${json}"
{
Expand Down Expand Up @@ -99,23 +84,8 @@ jobs:
run: |
set -x
mkdir -p artifacts && cd artifacts

# Get the URL from the event, or the act command line
artifacts_url=${{ github.event.workflow_run.artifacts_url || github.event.inputs.artifacts_url }}

if [[ "${{ matrix.platform }}" == "all" ]]; then
# allow everything through
grep="."
else
# only download event file and tests for this platform
grep="Event File|${{ matrix.platform }}"
fi
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | grep -E "$grep" | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
done
gh run download ${{ github.event.workflow_run.id }} --repo ${{ github.repository }} \

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either derive the run ID from the supplied URL here or remove the artifacts_url local-testing path consistently.

Removed the local-testing path consistently since it's sufficiently simple to run all this in one's own fork.

--name 'event-file' --pattern 'test-results-${{ matrix.platform == 'all' && '*' || format('*.{0}.*', matrix.platform) }}'

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
Expand All @@ -124,6 +94,6 @@ jobs:
check_name: ${{ matrix.platform == 'all' && 'Test Results' || format('Test Results ({0})', matrix.platform) }}
comment_mode: ${{ (matrix.platform == 'all') == (needs.discover-results.outputs.isall == '1') && 'always' || 'off' }}
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_file: artifacts/event-file/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
21 changes: 8 additions & 13 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@ permissions:
contents: read

jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Event File
path: ${{ github.event_path }}

changes:
name: Detect changed paths
runs-on: ubuntu-latest
name: Detect changes and upload events
runs-on: ubuntu-slim
outputs:
# Lint warnings are expected in this block
# https://github.com/dorny/paths-filter/issues/223#issuecomment-2463309889
Expand All @@ -46,8 +36,13 @@ jobs:
md: ${{ steps.filter.outputs.md || 'false' }}
other: ${{ steps.filter.outputs.other || 'false' }}
steps:
- name: Upload event file
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: 'event-file'
path: ${{ github.event_path }}
- name: Paths filter (PRs only)
if: github.event.pull_request.base
if: ${{ github.event_name == 'pull_request' }}
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
Expand Down
39 changes: 14 additions & 25 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
botName: Eclipse Platform Bot
botMail: platform-bot@eclipse.org

check-javadoc-consistency:
runs-on: ubuntu-latest
check-consistency:
runs-on: ubuntu-slim
permissions:
contents: read
steps:
Expand All @@ -31,35 +31,24 @@ jobs:
java-version: 25
distribution: 'temurin'
cache: maven
- name: Run JavaDoc basher
run: >
mvn --non-recursive --batch-mode --no-transfer-progress
-Pjavadoc-basher exec:exec@run-javadoc-basher
- name: Verify no changes
- name: Set up Maven
uses: stCarolas/setup-maven@12eb41b233df95d49b0c11fc1b5bc8312e5d4ce0 # v5.1
with:
maven-version: 3.9.16
- name: Verify JavaDoc consistency
run: |
mvn --non-recursive --batch-mode --no-transfer-progress \
-Pjavadoc-basher exec:exec@run-javadoc-basher

if ! git diff --exit-code ; then
echo "::error title=Inconsistent JavaDoc::JavaDoc-Basher discovered JavaDoc inconsistencies between implementations, which must be resolved."
exit 1
fi

check-jni-generator-consistency:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
- uses: actions/setup-java@de5a937a1dc73fbc1a67d7d1aa4bebc1082f3190 # v5.0.0
with:
java-version: 25
distribution: 'temurin'
cache: maven
- name: Run JNI generator
run: >
mvn --non-recursive --batch-mode --no-transfer-progress
-Pjni-generator exec:exec@run-jni-generator
- name: Verify no changes
- name: Verify JNI consistency
run: |
mvn --non-recursive --batch-mode --no-transfer-progress \
-Pjni-generator exec:exec@run-jni-generator
if ! git diff --exit-code ; then
echo "::error title=Outdated JNI glue code::The generated native sources (os.c, *_stats.*, *_structs.* ...) do not match the Java native declarations. Regenerate them with 'mvn --non-recursive -Pjni-generator exec:exec@run-jni-generator' and commit the result."
echo "::error title=Inconsistent JNI glue code::The generated native sources (os.c, *_stats.*, *_structs.* ...) do not match the Java native declarations. Regenerate them with 'mvn --non-recursive -Pjni-generator exec:exec@run-jni-generator' and commit the result."
exit 1
fi
15 changes: 0 additions & 15 deletions .github/workflows/updateRelease.yml

This file was deleted.

Loading