Skip to content

Commit b523816

Browse files
committed
fix: Build the Openfire docker image before testing
1 parent 16b7ff1 commit b523816

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

.github/workflows/integration-tests.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,27 @@ on:
88
branches: [ main ]
99

1010
jobs:
11-
integration-tests:
11+
build-and-test:
1212
runs-on: ubuntu-latest
1313
permissions:
1414
contents: read
1515
checks: write # Required for publishing test results
16+
packages: read # Required for pulling base images
1617

1718
steps:
19+
- name: Checkout Openfire
20+
uses: actions/checkout@v4
21+
with:
22+
repository: surevine/openfire
23+
path: openfire
24+
1825
- name: Checkout Integration Tests
1926
uses: actions/checkout@v4
2027
with:
2128
repository: surevine/openfire-integration-tests
2229
path: integration-tests
2330

24-
- name: Initialize Submodules
31+
- name: Initialize Integration Tests Submodules
2532
working-directory: integration-tests
2633
run: |
2734
git submodule update --init
@@ -33,6 +40,20 @@ jobs:
3340
java-version: '17'
3441
cache: 'maven'
3542

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+
3657
- name: Run Integration Tests
3758
working-directory: integration-tests
3859
run: ./mvnw -B verify
@@ -42,4 +63,15 @@ jobs:
4263
if: always() # Run even if tests fail
4364
with:
4465
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

Comments
 (0)