Skip to content

Commit 1ead2bb

Browse files
committed
ci : Run E2E tests against multiple versions of Docker
+ Use `crazy-max/ghaction-setup-docker` GitHub action to run E2E tests tied to a specific version of Docker + Add a minimal E2E test for windows that would just verify that DMP is able to build image with docker on windows + Add build job for verifying project compiles on Mac OS Signed-off-by: Rohan Kumar <[email protected]>
1 parent 68d31d0 commit 1ead2bb

File tree

5 files changed

+144
-7
lines changed

5 files changed

+144
-7
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,48 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21+
buildWithoutTests:
22+
name: BuildWithoutTests
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Cache .m2 registry
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.m2/repository
31+
key: cache-e2e-${{ github.sha }}-${{ github.run_id }}
32+
- name: Setup Java
33+
uses: actions/setup-java@v1
34+
with:
35+
java-version: '11'
36+
- name: Install DMP
37+
run: mvn ${MAVEN_ARGS} clean install -DskipTests -Djacoco.skip=true
38+
2139
build:
22-
name: Linux Java ${{ matrix.java }} Maven
40+
name: Docker ${{ matrix.docker }} on Linux
2341
runs-on: ubuntu-latest
42+
needs: buildWithoutTests
2443
strategy:
44+
fail-fast: false
2545
matrix:
26-
java: [11]
46+
docker: [v25.0.2, v24.0.9, v23.0.6]
2747
steps:
2848
- name: Checkout
2949
uses: actions/checkout@v2
3050
- name: Setup Java
3151
uses: actions/setup-java@v1
3252
with:
33-
java-version: ${{ matrix.java }}
34-
- name: Set up Docker Buildx
35-
uses: docker/setup-buildx-action@v2
36-
- name: Install Docker Maven Plugin
37-
run: mvn ${MAVEN_ARGS} clean install -DskipTests -Djacoco.skip=true
53+
java-version: '11'
54+
- name: Cache .m2 registry
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/.m2/repository
58+
key: cache-e2e-${{ github.sha }}-${{ github.run_id }}
59+
- name: Set up Docker
60+
uses: crazy-max/ghaction-setup-docker@v2
61+
with:
62+
version: ${{ matrix.docker }}
3863
- name: Run Integration tests
3964
run: |
4065
cd it/

.github/workflows/e2e-windows.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: E2E Tests
2+
3+
env:
4+
MAVEN_ARGS: -B -C -V -ntp -Dhttp.keepAlive=false -e
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
schedule:
13+
- cron: '0 1 * * *' # Every day at 1
14+
15+
jobs:
16+
windows-build:
17+
name: Windows
18+
runs-on: windows-latest
19+
steps:
20+
- name: Get Windows Version > Used to retrieve specific Docker Image
21+
shell: cmd
22+
run: |
23+
ver
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- name: Setup Java
27+
uses: actions/setup-java@v1
28+
with:
29+
java-version: '11'
30+
- name: Install DMP
31+
run: mvn ${MAVEN_ARGS} clean install -DskipTests
32+
- name: Run Integration tests
33+
run: |
34+
cd it/windows-build
35+
mvn clean install -Pwindows
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Mac OS Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
name: Java ${{ matrix.java }} Maven Wrapper
12+
runs-on: macos-13
13+
strategy:
14+
matrix:
15+
java: [11]
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Setup Java
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: ${{ matrix.java }}
23+
- name: Build Project
24+
run: ./mvnw -B -C -V -ntp clean install

it/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@
4444
<module>spring-boot-with-jib</module>
4545
<module>volume</module>
4646
<module>zero-config</module>
47+
<module>windows-build</module>
4748
</modules>
4849
</project>

it/windows-build/pom.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project>
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>io.fabric8.dmp.itests</groupId>
7+
<artifactId>dmp-it-parent</artifactId>
8+
<version>0.44-SNAPSHOT</version>
9+
<relativePath>../pom.xml</relativePath>
10+
</parent>
11+
12+
<groupId>fabric8io</groupId>
13+
<artifactId>dmp-it-windows-build</artifactId>
14+
<version>0.44-SNAPSHOT</version>
15+
16+
<profiles>
17+
<profile>
18+
<id>windows</id>
19+
<build>
20+
<plugins>
21+
<plugin>
22+
<groupId>io.fabric8</groupId>
23+
<artifactId>docker-maven-plugin</artifactId>
24+
<configuration>
25+
<images>
26+
<image>
27+
<name>%g/%a:${project.version}</name>
28+
<build>
29+
<from>mcr.microsoft.com/windows/nanoserver:ltsc2022</from>
30+
<assembly>
31+
<descriptorRef>artifact</descriptorRef>
32+
</assembly>
33+
</build>
34+
</image>
35+
</images>
36+
</configuration>
37+
38+
<executions>
39+
<execution>
40+
<id>build</id>
41+
<goals>
42+
<goal>build</goal>
43+
</goals>
44+
<phase>pre-integration-test</phase>
45+
</execution>
46+
</executions>
47+
</plugin>
48+
</plugins>
49+
</build>
50+
</profile>
51+
</profiles>
52+
</project>

0 commit comments

Comments
 (0)