Skip to content

Commit

Permalink
CI: Split up build flow to inject interop tests
Browse files Browse the repository at this point in the history
This splits the singular 'build' job into 'build' and 'deploy', and injects a new 'test' step in between.
  • Loading branch information
guusdk committed Oct 31, 2024
1 parent eaa3260 commit e4d0250
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,57 @@ jobs:
- name: Build with Maven
run: mvn -B package

- name: Stash the built artifacts
uses: actions/upload-artifact@v4
if: ${{ matrix.java == 11}}
with:
name: ${{ steps.get-id.outputs.id }}
path: target/${{ steps.get-id.outputs.id }}-openfire-plugin-assembly.jar
retention-days: 3

test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download the built plugin
uses: actions/download-artifact@v4
with:
name: monitoring
path: .

- name: Rename plugin
run: |
mv monitoring-openfire-plugin-assembly.jar monitoring.jar
- name: Run Openfire
uses: igniterealtime/[email protected]
with:
version: 4.9.0
plugin: ./monitoring.jar

- name: Run XMPP interop tests
uses: XMPP-Interop-Testing/xmpp-interop-tests-action@main
with:
domain: 'example.org'
adminAccountUsername: 'admin'
adminAccountPassword: 'admin'
enabledSpecifications: 'XEP-0136, XEP-0313'

deploy:
runs-on: ubuntu-latest
needs: test
steps:
- name: Download the built plugin
uses: actions/download-artifact@v4
with:
name: monitoring
path: .

- name: Igniterealtime CI Tooling
run: |
git clone --depth 1 https://github.com/igniterealtime/ci-tooling.git target/ci-tooling
cp target/ci-tooling/maven-settings-for-openfire-plugins.xml $HOME/.m2/settings.xml
- name: Conditionally Deploy to Igniterealtime Archiva
id: deploy
if: ${{ contains(github.repository, 'igniterealtime/') && ( ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || contains(github.ref, 'refs/tags/') ) && matrix.java == '11' }}
Expand Down

0 comments on commit e4d0250

Please sign in to comment.