Merge pull request #219 from Summer2023SHY/dependabot/maven/commons-i… #548
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
paths-ignore: | |
- "README.md" | |
- "Docs/*" | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- main | |
- dev | |
permissions: | |
actions: read | |
contents: write | |
issues: read | |
checks: write | |
pull-requests: write | |
jobs: | |
build: | |
name: Build JAR File | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Build JAR | |
run: | | |
mvn clean package -DskipTests | |
- name: Submit Dependency Snapshot | |
uses: advanced-security/maven-dependency-submission-action@v4.1.1 | |
- name: Upload JAR file | |
# if: false | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: actions/upload-artifact@v4.6.0 | |
with: | |
name: JDec-JAR | |
path: jdec-assembly/target/*.jar | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- name: Windows | |
tag: windows-latest | |
- name: Ubuntu | |
tag: ubuntu-latest | |
name: Unit Tests (${{ matrix.os.name }}) | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
runs-on: ${{ matrix.os.tag }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin # Eclipse Temurin | |
java-version: '17' # Java 17 (LTS) | |
cache: 'maven' | |
- name: Run Tests | |
run: | | |
mvn test | |
- name: Publish Test Results | |
if: ${{ always() }} | |
uses: mikepenz/action-junit-report@v5 | |
with: | |
report_paths: "**/TEST-*.xml" | |
exclude_sources: target/ | |
check_name: Test Results - ${{ matrix.os.name }} | |