2nd attempt to show test results of PRs from fork repositories #249
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WindowBuilder verification build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
check-dash-licenses: | ||
uses: eclipse-dash/dash-licenses/.github/workflows/mavenLicenseCheck.yml@90ebdf14dff066293b65b9d3ca99c8fb90d5222b # 1.1.0 | ||
with: | ||
projectId: tools.windowbuilder | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
java: [ 17, 21 ] | ||
runs-on: ${{ matrix.os }} | ||
name: OS ${{ matrix.os }} Java ${{ matrix.java }} compile | ||
timeout-minutes: 90 | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17/21 | ||
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 | ||
with: | ||
distribution: 'temurin' # See 'Supported distributions' for available options | ||
java-version: ${{ matrix.java }} | ||
cache: 'maven' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 | ||
with: | ||
maven-version: 3.9.2 | ||
- name: Build with Maven | ||
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 | ||
with: | ||
run: >- | ||
mvn -V -B -fae -ntp clean verify | ||
- name: Upload Test Results for Java-${{ matrix.java }} | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 | ||
if: always() | ||
with: | ||
name: test-results-${{ matrix.os }}-java${{ matrix.java }} | ||
if-no-files-found: error | ||
path: | | ||
${{ github.workspace }}/**/target/surefire-reports/*.xml | ||
unit-test-results: | ||
name: Unit Test Results | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
steps: | ||
- name: Download and Extract Artifacts | ||
run: | | ||
mkdir -p artifacts && cd artifacts | ||
artifacts_url=${{ github.event.workflow_run.artifacts_url }} | ||
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact | ||
do | ||
IFS=$'\t' read name url <<< "$artifact" | ||
gh api $url > "$name.zip" | ||
unzip -d "$name" "$name.zip" | ||
done | ||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@82082dac68ad6a19d980f8ce817e108b9f496c2a | ||
with: | ||
files: "artifacts/**/*.xml" |