Skip to content

Commit c16ffc1

Browse files
ccoltxjonashackt
andauthored
GitHub actions to build on multiple environments (linux and windows) (codecentric#1630)
* codecentric#1622: Using Actions matrix build feature to also build on Windows * codecentric#1622: Fixing `Unknown lifecycle phase ".javadoc.skip=true"` error on Windows builds. * codecentric#1622: Fixing problems on Windows with spring-javaformat-maven-plugin * Tagged testcases using docker * if docker isn't installed, they won't fail the build anymore * can be excluded using -DexcludedGroups=docker * codecentric#1622: Add springjava-format apply to PR GHA workflow. Also switched to verify in all build workflows. Co-authored-by: Jonas Hecht <jonas.hecht@codecentric.de>
1 parent 74bc342 commit c16ffc1

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

.github/workflows/build-feature.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-2016]
15+
16+
runs-on: ${{ matrix.os }}
1317
steps:
1418

1519
- uses: actions/checkout@v2
@@ -19,8 +23,12 @@ jobs:
1923
with:
2024
java-version: 1.8
2125

26+
# since we also build on Windows Powershell, we need to add a space between -D maven.javadoc.skip=true
27+
# otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error
2228
- name: Build with Maven
23-
run: mvn -B install -P coverage --no-transfer-progress -Dmaven.javadoc.skip=true
29+
run: |
30+
mvn -B spring-javaformat:apply --no-transfer-progress
31+
mvn -B verify -P coverage --no-transfer-progress -D maven.javadoc.skip=true
2432
2533
- uses: codecov/codecov-action@v1
2634
with:

.github/workflows/build-main.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-2016]
15+
16+
runs-on: ${{ matrix.os }}
1317
steps:
1418

1519
- uses: actions/checkout@v2
@@ -19,8 +23,12 @@ jobs:
1923
with:
2024
java-version: 1.8
2125

26+
# since we also build on Windows Powershell, we need to add a space between -D maven.javadoc.skip=true
27+
# otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error
2228
- name: Build with Maven
23-
run: mvn -B install -P coverage --no-transfer-progress -Dmaven.javadoc.skip=true
29+
run: |
30+
mvn -B spring-javaformat:apply --no-transfer-progress
31+
mvn -B verify -P coverage --no-transfer-progress -D maven.javadoc.skip=true
2432
2533
- uses: codecov/codecov-action@v1
2634
with:

.github/workflows/build-pullrequest.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ on:
55

66
jobs:
77
build:
8-
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, windows-2016]
11+
12+
runs-on: ${{ matrix.os }}
913
steps:
1014

1115
- uses: actions/checkout@v2
@@ -15,8 +19,12 @@ jobs:
1519
with:
1620
java-version: 1.8
1721

22+
# since we also build on Windows Powershell, we need to add a space between -D maven.javadoc.skip=true
23+
# otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error
1824
- name: Build with Maven
19-
run: mvn -B install -P coverage --no-transfer-progress -Dmaven.javadoc.skip=true
25+
run: |
26+
mvn -B spring-javaformat:apply --no-transfer-progress
27+
mvn -B verify -P coverage --no-transfer-progress -D maven.javadoc.skip=true
2028
2129
- uses: codecov/codecov-action@v1
2230
with:

spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/eventstore/HazelcastEventStoreWithClientConfigTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2020 the original author or authors.
2+
* Copyright 2014-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
import com.hazelcast.client.config.ClientConfig;
2222
import com.hazelcast.core.HazelcastInstance;
2323
import com.hazelcast.map.IMap;
24+
import org.junit.jupiter.api.Tag;
2425
import org.springframework.boot.autoconfigure.hazelcast.HazelcastClientFactory;
2526
import org.testcontainers.containers.GenericContainer;
2627
import org.testcontainers.junit.jupiter.Container;
@@ -29,11 +30,12 @@
2930
import de.codecentric.boot.admin.server.domain.events.InstanceEvent;
3031
import de.codecentric.boot.admin.server.domain.values.InstanceId;
3132

32-
@Testcontainers
33+
@Testcontainers(disabledWithoutDocker = true)
34+
@Tag("docker")
3335
public class HazelcastEventStoreWithClientConfigTest extends AbstractEventStoreTest {
3436

3537
@Container
36-
private static final GenericContainer hazelcastServer = new GenericContainer("hazelcast/hazelcast:4.0")
38+
private static final GenericContainer<?> hazelcastServer = new GenericContainer<>("hazelcast/hazelcast:4.0")
3739
.withExposedPorts(5701);
3840

3941
private final HazelcastInstance hazelcast;

0 commit comments

Comments
 (0)