forked from geoserver/geoserver
-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (97 loc) · 4.05 KB
/
assembly.yml
File metadata and controls
107 lines (97 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Assembly GitHub CI
on:
pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MAVEN_OPTS: -Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 -Daether.syncContext.named.time=120 -Daether.syncContext.named.factory=file-lock -Daether.syncContext.named.nameMapper=file-gav -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx2g -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dspotless.apply.skip=true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
jdk: 17
dist: 'temurin'
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.jdk }}
distribution: ${{ matrix.dist }}
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.8
- name: Maven repository caching
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: gs-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
gs-${{ runner.os }}-maven-
- name: Build GeoServer modules and extensions without tests
run: |
mvn --version
mvn -B -ntp -U -T1C -DskipTests -Prelease -f src/pom.xml install
- name: Package GeoServer modules and extensions
run: |
mvn -B -ntp -nsu -N -f src/pom.xml assembly:single
- name: Build and package community modules (without tests)
run: |
mvn -B -ntp -nsu -U -T1C -DskipTests -PcommunityRelease,assembly -f src/community/pom.xml install
- name: Test binary package startup (Jetty 10.x smoke test)
run: |
# Extract version from Maven project
VERSION=$(mvn -f src/pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Testing GeoServer version: $VERSION"
# Test endpoint URL
TEST_URL="http://localhost:8080/geoserver/wms?request=GetCapabilities&version=1.3.0"
# Create test directory and extract binary package
mkdir -p /tmp/geoserver-test
cd /tmp/geoserver-test
cp $GITHUB_WORKSPACE/src/target/release/geoserver-${VERSION}-bin.zip .
unzip -q geoserver-${VERSION}-bin.zip
# Start GeoServer in background
echo "Starting GeoServer..."
bin/startup.sh &
GEOSERVER_PID=$!
# Wait for startup (up to 120 seconds)
echo "Waiting for GeoServer to start..."
for i in {1..60}; do
if curl -f -s -o /dev/null "$TEST_URL"; then
echo "✅ GeoServer started successfully after $i attempts"
curl -I "$TEST_URL"
break
fi
if [ $i -eq 60 ]; then
echo "❌ GeoServer failed to start within 120 seconds"
# Show startup logs for debugging
echo "=== Startup logs ==="
if [ -f logs/geoserver.log ]; then cat logs/geoserver.log; fi
kill $GEOSERVER_PID || true
exit 1
fi
echo "Attempt $i: GeoServer not ready yet, waiting 2 seconds..."
sleep 2
done
# Verify WMS GetCapabilities returns 200 OK
RESPONSE=$(curl -s -w "%{http_code}" -o /dev/null "$TEST_URL")
if [ "$RESPONSE" = "200" ]; then
echo "✅ WMS GetCapabilities returned HTTP 200 - Binary package test PASSED"
else
echo "❌ WMS GetCapabilities returned HTTP $RESPONSE - Binary package test FAILED"
kill $GEOSERVER_PID || true
exit 1
fi
# Clean shutdown
kill $GEOSERVER_PID || true
sleep 5
echo "🎉 Binary package smoke test completed successfully"
- name: Remove SNAPSHOT jars from repository
if: always()
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}