Skip to content

Fail CI on Missing Test-Results (#42) #23

Fail CI on Missing Test-Results (#42)

Fail CI on Missing Test-Results (#42) #23

name: Build, Test & Publish
on:
push:
branches:
- "main"
- "maintenance/*"
tags:
- "v*"
jobs:
version:
name: Determine Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/[email protected]
name: Checkout
with:
fetch-depth: 2
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Detect Version
id: version
run: VERSION=$(mvn -B -q -N exec:exec -Dexec.executable=echo -Dexec.args='${project.version}')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
build-and-test:
name: Build and Test (Solr ${{matrix.solr}} / Java${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 11, 8 ]
solr: [ 8.11.1, 7.7.3, 6.6.6 ]
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Compile & Test
env:
SOLR_VERSION: ${{ matrix.solr }}
run: mvn -V -B --no-transfer-progress
clean package verify
-Prelease
-Dgpg.skip
-Dsolr.version=${SOLR_VERSION}
- name: Upload Test-Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results (${{matrix.solr}} - Java${{ matrix.java }})
path: '**/TEST-*.xml'
publish-test-results:
name: Publish Test Results
needs: [ build-and-test ]
runs-on: ubuntu-latest
if: always()
steps:
- name: Fetch Test-Results
uses: actions/download-artifact@v3
with:
path: test-results
- name: Publish Test-Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: 'test-results/**/TEST-*.xml'
action_fail_on_inconclusive: 'true'
deploy:
name: Publish
needs:
- version
- build-and-test
runs-on: ubuntu-latest
if: github.repository == 'redlink-gmbh/solr-compound-word-filter'
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish Packages
run: mvn -B --no-transfer-progress
package deploy
-Prelease
-Dquick
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}