Skip to content

Commit 6a0e7e5

Browse files
committed
CI: include CI for Windows and MacOS
As we're producing binaries for Windows, and that OS notably differs from Linux in things like the representation of a path on the file system, we should run CI in a Windows environment in addition to running it on Linux-based environments. While we're at it, we might as well also include MacOS.
1 parent b291450 commit 6a0e7e5

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,33 @@ jobs:
1515
build:
1616

1717
name: Build Openfire from source
18-
runs-on: ubuntu-latest
1918
strategy:
2019
matrix:
20+
os: [ubuntu-latest, windows-latest, macos-latest]
2121
java: [ 17, 21, 25 ]
2222
distribution: [ zulu ] # We could add more here: temurin, adopt, liberica, microsoft, corretto
2323

24+
runs-on: ${{ matrix.os }}
25+
2426
steps:
2527
- uses: actions/checkout@v6
26-
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
28+
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }} on ${{ matrix.os }}
2729
uses: actions/setup-java@v5
2830
with:
2931
java-version: ${{ matrix.java }}
3032
distribution: ${{ matrix.distribution }}
3133
cache: maven
34+
- name: Build with Maven while generating code coverage report # We install instead of package, because we want the result in the local mvn repo
35+
if: ${{ github.ref_name == 'main' }}
36+
run: ./mvnw -B install -Pcoverage --file pom.xml
3237
- name: Build with Maven # We install instead of package, because we want the result in the local mvn repo
33-
run: |
34-
if [[ ${{ github.ref_name }} == 'main' ]]; then
35-
./mvnw -B install -Pcoverage --file pom.xml
36-
else
37-
./mvnw -B install
38-
fi
38+
if: ${{ github.ref_name != 'main' }}
39+
run: ./mvnw -B install --file pom.xml
3940
- name: Upload failed test reports
4041
uses: actions/upload-artifact@v7
4142
if: always()
4243
with:
43-
name: Openfire Build Java ${{ matrix.java }} JUnit Test reports
44+
name: Openfire Build Java ${{ matrix.java }} ${{ matrix.distribution }} on ${{ runner.os }} JUnit Test reports
4445
path: xmppserver/target/surefire-reports
4546
- name: tar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
4647
if: ${{ matrix.distribution == 'zulu' }}
@@ -49,16 +50,16 @@ jobs:
4950
if: ${{ matrix.distribution == 'zulu' }}
5051
uses: actions/upload-artifact@v7
5152
with:
52-
name: Openfire Distribution Java ${{ matrix.java }}
53+
name: Openfire Distribution Java ${{ matrix.java }} ${{ matrix.distribution }} on ${{ runner.os }}
5354
path: distribution-artifact.tar
5455
- name: Upload coverage report for 'xmppserver' module
55-
if: ${{ matrix.distribution == 'zulu' && matrix.java == 17 && github.ref_name == 'main'}}
56+
if: ${{ matrix.distribution == 'zulu' && matrix.java == 17 && matrix.os == 'ubuntu-latest' && github.ref_name == 'main'}}
5657
uses: actions/upload-artifact@v7
5758
with:
5859
name: Openfire Build Java ${{ matrix.java }} Unit Test Coverage Report (for 'xmppserver' module)
5960
path: xmppserver/target/site/jacoco/
6061
- name: Temporarily stash openfire artifacts from the mvn repo for later jobs
61-
if: ${{ matrix.distribution == 'zulu' && matrix.java == 17 }}
62+
if: ${{ matrix.distribution == 'zulu' && matrix.java == 17 && matrix.os == 'ubuntu-latest'}}
6263
uses: actions/upload-artifact@v7
6364
with:
6465
name: Maven Repository
@@ -165,7 +166,7 @@ jobs:
165166
- name: Download distribution artifact from build job.
166167
uses: actions/download-artifact@v8
167168
with:
168-
name: Openfire Distribution Java 17
169+
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
169170
path: .
170171
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
171172
run: tar -xf distribution-artifact.tar
@@ -264,7 +265,7 @@ jobs:
264265
- name: Download distribution artifact from build job.
265266
uses: actions/download-artifact@v8
266267
with:
267-
name: Openfire Distribution Java 17
268+
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
268269
path: .
269270
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
270271
run: tar -xf distribution-artifact.tar
@@ -293,7 +294,7 @@ jobs:
293294
- name: Download distribution artifact from build job.
294295
uses: actions/download-artifact@v8
295296
with:
296-
name: Openfire Distribution Java 17
297+
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
297298
path: .
298299
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
299300
run: tar -xf distribution-artifact.tar
@@ -863,7 +864,7 @@ jobs:
863864
- name: Download distribution artifact from build job.
864865
uses: actions/download-artifact@v8
865866
with:
866-
name: Openfire Distribution Java 17
867+
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
867868
path: .
868869
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
869870
run: tar -xf distribution-artifact.tar

0 commit comments

Comments
 (0)