Skip to content

fix: Build the Openfire docker image before testing #4

fix: Build the Openfire docker image before testing

fix: Build the Openfire docker image before testing #4

name: Integration Tests
on:
workflow_dispatch: # Allows manual triggering
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write # Required for publishing test results
packages: read # Required for pulling base images
steps:
- name: Checkout Openfire
uses: actions/checkout@v4
with:
repository: surevine/openfire
path: openfire
- name: Checkout Integration Tests
uses: actions/checkout@v4
with:
repository: surevine/openfire-integration-tests
path: integration-tests
- name: Initialize Integration Tests Submodules
working-directory: integration-tests
run: |
git submodule update --init
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build Openfire
working-directory: openfire
run: |
# Skip tests and just package
./mvnw -B -DskipTests clean package
- name: Build Docker Image
working-directory: openfire
run: |
docker build -t openfire:latest .
# Verify the image was built
docker images openfire:latest
- name: Run Integration Tests
working-directory: integration-tests
run: ./mvnw -B verify
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() # Run even if tests fail
with:
junit_files: "integration-tests/target/surefire-reports/*.xml,integration-tests/target/failsafe-reports/*.xml"
check_name: "Integration Test Results"
- name: Archive Test Artifacts
if: always() # Run even if tests fail
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
integration-tests/target/surefire-reports/
integration-tests/target/failsafe-reports/
integration-tests/target/site/serenity/
retention-days: 30