8
8
branches : [ main ]
9
9
10
10
jobs :
11
- integration-tests :
11
+ build-and-test :
12
12
runs-on : ubuntu-latest
13
13
permissions :
14
14
contents : read
15
15
checks : write # Required for publishing test results
16
+ packages : read # Required for pulling base images
16
17
17
18
steps :
19
+ - name : Checkout Openfire
20
+ uses : actions/checkout@v4
21
+ with :
22
+ repository : surevine/openfire
23
+ path : openfire
24
+
18
25
- name : Checkout Integration Tests
19
26
uses : actions/checkout@v4
20
27
with :
21
28
repository : surevine/openfire-integration-tests
22
29
path : integration-tests
23
30
24
- - name : Initialize Submodules
31
+ - name : Initialize Integration Tests Submodules
25
32
working-directory : integration-tests
26
33
run : |
27
34
git submodule update --init
33
40
java-version : ' 17'
34
41
cache : ' maven'
35
42
43
+ - name : Build Openfire
44
+ working-directory : openfire
45
+ run : |
46
+ ./mvnw -B clean package
47
+ # Copy the distribution artifact to where Docker expects it
48
+ cp distribution/target/distribution-*.tar.gz distribution/target/distribution.tar.gz
49
+
50
+ - name : Build Docker Image
51
+ working-directory : openfire
52
+ run : |
53
+ docker build -t openfire:latest .
54
+ # Verify the image was built
55
+ docker images openfire:latest
56
+
36
57
- name : Run Integration Tests
37
58
working-directory : integration-tests
38
59
run : ./mvnw -B verify
42
63
if : always() # Run even if tests fail
43
64
with :
44
65
junit_files : " integration-tests/target/surefire-reports/*.xml,integration-tests/target/failsafe-reports/*.xml"
45
- check_name : " Integration Test Results"
66
+ check_name : " Integration Test Results"
67
+
68
+ - name : Archive Test Artifacts
69
+ if : always() # Run even if tests fail
70
+ uses : actions/upload-artifact@v4
71
+ with :
72
+ name : test-results
73
+ path : |
74
+ integration-tests/target/surefire-reports/
75
+ integration-tests/target/failsafe-reports/
76
+ integration-tests/target/site/serenity/
77
+ retention-days : 30
0 commit comments