Skip to content

Commit 46f5008

Browse files
committed
build: configure Maven wrapper and modernize GHA workflows
1 parent 911fc2e commit 46f5008

File tree

9 files changed

+809
-113
lines changed

9 files changed

+809
-113
lines changed

.github/workflows/MacOsPR.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
2+
name: Build
3+
4+
on: # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
5+
push:
6+
branches-ignore: # build all branches except:
7+
- 'dependabot/**' # prevent GHA triggered twice (once for commit to the branch and once for opening/syncing the PR)
8+
tags-ignore: # don't build tags
9+
- '**'
10+
paths-ignore:
11+
- '**/*.md'
12+
- '.github/*.yml'
13+
- '.github/workflows/codeql.yml'
14+
- '.github/workflows/licensecheck.yml'
15+
- '.github/workflows/updateTarget.yml'
16+
- '**/.project'
17+
- '**/.settings/*.prefs'
18+
- '.gitignore'
19+
- '.actrc'
20+
- 'Jenkinsfile'
21+
pull_request:
22+
paths-ignore:
23+
- '**/*.md'
24+
- '.github/*.yml'
25+
- '.github/workflows/codeql.yml'
26+
- '.github/workflows/licensecheck.yml'
27+
- '.github/workflows/updateTarget.yml'
28+
- '**/.project'
29+
- '**/.settings/*.prefs'
30+
- '.gitignore'
31+
- '.actrc'
32+
- 'Jenkinsfile'
33+
workflow_dispatch:
34+
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch
35+
inputs:
36+
additional_maven_args:
37+
description: 'Additional Maven Args'
38+
required: false
39+
default: ''
40+
debug-with-ssh:
41+
description: "When to open an SSH session for post-build debugging:"
42+
default: never
43+
type: choice
44+
options: [ always, on_failure, on_failure_or_cancelled, never ]
45+
debug-with-ssh-only-for-actor:
46+
description: "Restrict SSH debug session access to the GitHub user who triggered the workflow"
47+
default: true
48+
type: boolean
49+
50+
51+
defaults:
52+
run:
53+
shell: bash
54+
55+
56+
env:
57+
JAVA_VERSION: 21
58+
59+
60+
jobs:
61+
62+
###########################################################
63+
build:
64+
###########################################################
65+
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
os: # https://github.com/actions/runner-images#available-images
70+
- ubuntu-latest
71+
- macos-15-intel # Intel
72+
- macos-latest # ARM
73+
- windows-latest
74+
runs-on: ${{ matrix.os }}
75+
timeout-minutes: 20
76+
77+
78+
steps:
79+
- name: "Show: GitHub context"
80+
env:
81+
GITHUB_CONTEXT: ${{ toJSON(github) }}
82+
run: printf '%s' "$GITHUB_CONTEXT" | python -m json.tool
83+
84+
85+
- name: "Show: environment variables"
86+
run: env | sort
87+
88+
89+
- name: Git Checkout
90+
uses: actions/checkout@v5 # https://github.com/actions/checkout
91+
with:
92+
fetch-depth: 0 # required to prevent tycho-p2-extras-plugin:compare-version-with-baseline potentially failing the build
93+
94+
95+
- name: Configure fast APT repository mirror
96+
if: runner.os == 'Linux'
97+
uses: vegardit/fast-apt-mirror.sh@v1
98+
99+
100+
- name: "Install: Linux packages 📦"
101+
if: runner.os == 'Linux'
102+
run: |
103+
set -eux
104+
sudo apt-get install --no-install-recommends -y xvfb
105+
106+
# prevents: "Failed to execute child process “dbus-launch” (No such file or directory)"
107+
sudo apt-get install --no-install-recommends -y dbus-x11
108+
109+
# prevents: "dbind-WARNING **: 20:17:55.046: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files"
110+
# see https://gist.github.com/jeffcogswell/62395900725acef1c0a5a608f7eb7a05
111+
sudo apt-get install --no-install-recommends -y at-spi2-core
112+
113+
# prevents:
114+
# java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
115+
# no swt-pi4-gtk-4956r13 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
116+
# no swt-pi4-gtk in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
117+
# no swt-pi4 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
118+
sudo apt-get install --no-install-recommends -y libswt-gtk-*-java
119+
120+
# prevents:
121+
# java.io.IOException: Cannot run program "xdg-mime": error=2, No such file or directory
122+
# at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
123+
# at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
124+
# at org.eclipse.urischeme.internal.registration.ProcessExecutor.execute(ProcessExecutor.java:36)
125+
# at org.eclipse.urischeme.internal.registration.RegistrationLinux.getRegisteredDesktopFileForScheme(RegistrationLinux.java:144)
126+
# at org.eclipse.urischeme.internal.registration.RegistrationLinux.determineHandlerLocation(RegistrationLinux.java:86)
127+
# at org.eclipse.urischeme.internal.registration.RegistrationLinux.getSchemesInformation(RegistrationLinux.java:75)
128+
# at org.eclipse.urischeme.AutoRegisterSchemeHandlersJob.run(AutoRegisterSchemeHandlersJob.java:85)
129+
sudo apt-get install --no-install-recommends -y xdg-utils
130+
131+
132+
- name: "Install: JDK ${{ env.JAVA_VERSION }} ☕"
133+
uses: actions/setup-java@v5 # https://github.com/actions/setup-java
134+
with:
135+
distribution: temurin
136+
java-version: ${{ env.JAVA_VERSION }}
137+
138+
139+
- name: "Install: Node 22 🍵"
140+
uses: actions/setup-node@v6
141+
with:
142+
node-version: 22
143+
144+
145+
- name: "Cache: Local Maven Repository"
146+
uses: actions/cache@v4
147+
with:
148+
# Excluded sub directory not working https://github.com/actions/toolkit/issues/713
149+
path: |
150+
~/.m2/repository/*
151+
!~/.m2/repository/.cache/tycho
152+
!~/.m2/repository/.meta/p2-artifacts.properties
153+
!~/.m2/repository/p2
154+
!~/.m2/repository/*SNAPSHOT*
155+
key: ${{ runner.os }}-${{ runner.arch }}-repo-mvn-${{ hashFiles('**/pom.xml') }}
156+
157+
158+
- name: "Cache: Local Tycho Repository"
159+
uses: actions/cache@v4
160+
with:
161+
path: |
162+
~/.m2/repository/.cache/tycho
163+
~/.m2/repository/.meta/p2-artifacts.properties
164+
~/.m2/repository/p2
165+
key: ${{ runner.os }}-${{ runner.arch }}-repo-tycho-${{ hashFiles('target-platform/target-platform.target') }}
166+
167+
168+
- name: "Build with Maven 🔨"
169+
run: |
170+
set -euo pipefail
171+
172+
MAVEN_OPTS="${MAVEN_OPTS:-}"
173+
if [[ "${{ runner.os }}" == "Windows" ]]; then
174+
MAVEN_OPTS+=" -Djava.security.egd=file:/dev/urandom" # https://www.baeldung.com/java-security-egd#bd-testing-the-effect-of-javasecurityegd
175+
else
176+
MAVEN_OPTS+=" -Djava.security.egd=file:/dev/./urandom" # https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for/59097932#59097932
177+
fi
178+
MAVEN_OPTS+=" -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS" # https://stackoverflow.com/questions/5120470/how-to-time-the-different-stages-of-maven-execution/49494561#49494561
179+
MAVEN_OPTS+=" -Xmx1024m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dhttps.protocols=TLSv1.3,TLSv1.2"
180+
export MAVEN_OPTS
181+
echo "MAVEN_OPTS: $MAVEN_OPTS"
182+
183+
if [[ ${ACT:-} == "true" ]]; then # when running locally using nektos/act
184+
maven_args="-Djgit.dirtyWorkingTree=warning"
185+
else
186+
maven_args="--no-transfer-progress"
187+
fi
188+
189+
# prevent "org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]" on Linux
190+
${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1600x900x24" \' || '' }}
191+
./mvnw \
192+
--errors \
193+
--update-snapshots \
194+
--batch-mode \
195+
--show-version \
196+
-Declipse.p2.mirrors=false \
197+
-Dsurefire.rerunFailingTestsCount=3 \
198+
$maven_args \
199+
${{ github.event.inputs.additional_maven_args }} \
200+
clean verify || (
201+
rc=$?
202+
if [[ ${ACT:-} != "true" ]]; then
203+
find . -path "*/target/work/data/.metadata/.log" | while IFS= read -r file; do
204+
echo "::group::$file"
205+
cat "$file"
206+
echo "::endgroup::"
207+
done
208+
fi
209+
exit $rc
210+
)
211+
212+
213+
- name: "Upload: Repository Zip"
214+
uses: actions/upload-artifact@v5
215+
if: runner.os == 'Linux'
216+
with:
217+
name: org.eclipse.wildwebdeveloper.repository-${{ github.sha }}
218+
path: repository/target/repository-*.zip
219+
retention-days: 14
220+
221+
222+
##################################################
223+
# Setup SSH debug session
224+
##################################################
225+
- name: "SSH session for debugging: check"
226+
id: DEBUG_SSH_SESSSION_CHECK
227+
if: always()
228+
run: |
229+
set -eu
230+
231+
when="${{ inputs.debug-with-ssh }}"
232+
233+
if [[ $when == "always" ]] || case "${{ job.status }}" in
234+
success) [[ $when == "always" ]] ;;
235+
cancelled) [[ $when == "on_failure_or_cancelled" ]] ;;
236+
failure) [[ $when == "on_failure"* ]] ;;
237+
esac; then
238+
echo "start_ssh_session=true" | tee -a "$GITHUB_OUTPUT"
239+
fi
240+
241+
242+
- name: "SSH session for debugging: start"
243+
uses: mxschmitt/action-tmate@v3 # https://github.com/mxschmitt/action-tmate
244+
if: always() && steps.DEBUG_SSH_SESSSION_CHECK.outputs.start_ssh_session
245+
with:
246+
limit-access-to-actor: ${{ inputs.debug-with-ssh-only-for-actor }}

.github/workflows/windowsPR.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.4
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Eclipse Wild Web Developer : 🌐 Web dev in Eclipse IDE 🌘
22

3+
[![GitHub Actions](https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/actions/workflows/build.yml/badge.svg)](https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/actions/workflows/build.yml)
4+
[![Jenkins tests](https://img.shields.io/jenkins/tests?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fwildwebdeveloper%2Fjob%2FWildwebdeveloper%2Fjob%2Fmaster%2F&logo=jenkins&logoColor=white)](https://ci.eclipse.org/wildwebdeveloper/job/Wildwebdeveloper/)
5+
[![License](https://img.shields.io/github/license/eclipse-wildwebdeveloper/wildwebdeveloper.svg?color=blue)](LICENSE)
6+
37
🖊️ **Edit** of HTML, CSS, JavaScript, TypeScript, JSON+schema, XML+schema, YAML+schema+Kubernetes and 🦟🔫 **debug** Node.js and HTML+JS web-apps simply and efficiently in the 🌘 Eclipse IDE.
48

59
To see it in action, open the desired file with the Generic Editor that's included by default in the Eclipse IDE.

0 commit comments

Comments
 (0)