@@ -14,35 +14,21 @@ jobs:
1414 os : [ ubuntu-latest, windows-latest, macos-latest ]
1515 fail-fast : false
1616 runs-on : ${{ matrix.os }}
17+ services :
18+ s3mock :
19+ # This service will only start if the runner is Linux
20+ image : ${{ matrix.os == 'ubuntu-latest' && 'adobe/s3mock:3.11.0' || '' }}
21+ ports :
22+ - 9090:9090
23+ env :
24+ initialBuckets : zarr-test-bucket
1725 defaults :
1826 run :
1927 shell : bash
2028
2129 steps :
2230 - uses : actions/checkout@v5
2331
24- - name : Start S3Mock
25- if : runner.os != 'macOS'
26- run : |
27- docker run -d -p 9090:9090 -p 9191:9191 \
28- --name s3mock \
29- -e "initialBuckets=zarr-test-bucket" \
30- adobe/s3mock:3.11.0
31-
32- # TODO: move this waiting logic right in front of the tests that need it
33- - name : Wait for S3Mock
34- if : runner.os != 'macOS'
35- run : |
36- echo "Waiting for S3Mock to start..."
37- for i in {1..30}; do
38- if curl -s http://localhost:9090/favicon.ico > /dev/null; then
39- echo "S3Mock is up!"
40- exit 0
41- fi
42- sleep 2
43- done
44- echo "S3Mock failed to start"
45- exit 1
4632 - name : Set up JDK
4733 uses : actions/setup-java@v4
4834 with :
@@ -71,12 +57,12 @@ jobs:
7157 - name : Test
7258 env :
7359 MAVEN_OPTS : " -Xmx6g"
74- SKIP_S3_TESTS : ${{ matrix.os == 'macos-latest' }}
7560 run : |
76- if [ "$SKIP_S3_TESTS" = "true" ]; then
77- mvn --no-transfer-progress test -DargLine="-Xmx6g" -Dgroups="!s3"
78- else
61+ if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
7962 mvn --no-transfer-progress test -DargLine="-Xmx6g"
63+ else
64+ # Skip S3 tests on Windows/macOS where the service isn't running (labeled with @Tag("s3"))
65+ mvn --no-transfer-progress test -DargLine="-Xmx6g" -DexcludedGroups="s3"
8066 fi
8167 - name : Assemble JAR
8268 run : mvn package -DskipTests
0 commit comments