diff --git a/.config/checkstyle/checkstyle.xml b/.config/checkstyle/checkstyle.xml index 94a22c6c..cd401396 100644 --- a/.config/checkstyle/checkstyle.xml +++ b/.config/checkstyle/checkstyle.xml @@ -65,6 +65,7 @@ + @@ -81,15 +82,13 @@ - + - - - + @@ -146,7 +145,9 @@ - + + + diff --git a/.config/pmd/java/ruleset.xml b/.config/pmd/java/ruleset.xml index b6d43e51..4c72bf23 100644 --- a/.config/pmd/java/ruleset.xml +++ b/.config/pmd/java/ruleset.xml @@ -141,6 +141,7 @@ + @@ -168,7 +169,7 @@ - + diff --git a/.github/.lycheeignore b/.github/.lycheeignore index 8ef92f9b..b1786c29 100644 --- a/.github/.lycheeignore +++ b/.github/.lycheeignore @@ -1,5 +1,6 @@ # Ignorefile for broken link check localhost mvnrepository.com +stackoverflow.com # Hides behind CloudFlare showcase.primefaces.org diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 125f7977..ba17c479 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -61,4 +61,4 @@ body: attributes: label: Additional information description: | - Any other relevant information you'd like to include + Any other relevant information you'd like to include, e.g. screenshots or video recordings of the bug diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml index fbe05e74..8aeed096 100644 --- a/.github/workflows/broken-links.yml +++ b/.github/workflows/broken-links.yml @@ -19,7 +19,7 @@ jobs: - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 + uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2 with: args: "--verbose --no-progress './**/*.md'" fail: false # Don't fail on broken links, create an issue instead diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index c2d4dfec..9e515f6a 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -19,9 +19,6 @@ on: - '.idea/**' - 'assets/**' -env: - DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo - jobs: build: runs-on: ubuntu-latest @@ -33,19 +30,31 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java }} - - - name: Cache Maven - uses: actions/cache@v6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-mvn-build- + - parallel: + - name: Set up JDK + uses: actions/setup-java@v6 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + + - name: Cache Maven + uses: actions/cache@v6 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-mvn-build- + + - name: Docker Image Cache Restore + id: docker-image-cache-restore + uses: xdev-software/tci/.github/actions/docker-image-cache/restore@f75904872b55915e2a2f0080779a36e27c467d21 # v4.5.3 + with: + # This cache could always change however because docker images can be changed remotely if the version is not fixated + # As a compromise it utilizes the hash of the pom files because when the dependencies stay the same + # the images should also be roughly the same + key: ${{ runner.os }}-build-docker-images-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-build-docker-images- - name: Build with Maven run: ./mvnw -B clean package -P run-integration-tests @@ -68,20 +77,13 @@ jobs: exit 1 fi - - name: Upload demo files - uses: actions/upload-artifact@v7 - with: - name: demo-files-java-${{ matrix.java }} - path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar - if-no-files-found: error - - - name: Upload screenshots of test failures - if: failure() - uses: actions/upload-artifact@v7 + - name: Docker Image Cache Save + uses: xdev-software/tci/.github/actions/docker-image-cache/save@f75904872b55915e2a2f0080779a36e27c467d21 # v4.5.3 + # Only save cache for one instance, otherwise they try to overwrite each other + if: ${{ matrix.java == 25 }} with: - name: test-fail-screenshots-${{ matrix.java }} - path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/screenshots - if-no-files-found: ignore + key: ${{ steps.docker-image-cache-restore.outputs.key }} + cache-hit: ${{ steps.docker-image-cache-restore.outputs.cache-hit }} checkstyle: runs-on: ubuntu-latest @@ -94,27 +96,28 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java }} - - - name: Cache Maven - uses: actions/cache@v6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-mvn-checkstyle- - - - name: CheckStyle Cache - uses: actions/cache@v6 - with: - path: '**/target/checkstyle-cachefile' - key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-checkstyle- + - parallel: + - name: Set up JDK + uses: actions/setup-java@v6 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + + - name: Cache Maven + uses: actions/cache@v6 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-mvn-checkstyle- + + - name: CheckStyle Cache + uses: actions/cache@v6 + with: + path: '**/target/checkstyle-cachefile' + key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-checkstyle- - name: Run Checkstyle run: ./mvnw -B checkstyle:check -P checkstyle -T2C @@ -130,33 +133,34 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java }} - - - name: Cache Maven - uses: actions/cache@v6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-mvn-pmd- - - - name: PMD Cache - uses: actions/cache@v6 - with: - path: '**/target/pmd/pmd.cache' - key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-pmd- + - parallel: + - name: Set up JDK + uses: actions/setup-java@v6 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + + - name: Cache Maven + uses: actions/cache@v6 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-mvn-pmd- + + - name: PMD Cache + uses: actions/cache@v6 + with: + path: '**/target/pmd/pmd.cache' + key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-pmd- - name: Run PMD - run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C + run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -T2C - name: Run CPD (Copy Paste Detector) - run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C + run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -T2C - name: Upload report if: ${{ !cancelled() }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1928bba3..6bf94f6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,6 @@ on: push: branches: [ master ] -env: - PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - -permissions: - contents: write - pull-requests: write - # DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario # where a supply chain attack could be achieved due to poisoned cache jobs: @@ -20,24 +13,26 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up JDK - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'temurin' - - # Try to reuse existing cache from check-build - - name: Try restore Maven Cache - uses: actions/cache/restore@v6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-mvn-build- + - parallel: + - name: Set up JDK + uses: actions/setup-java@v6 + with: + java-version: '17' + distribution: 'temurin' + + # Try to reuse existing cache from check-build + - name: Try restore Maven Cache + uses: actions/cache/restore@v6 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-mvn-build- - name: Build with Maven - run: ./mvnw -B clean package -T2C - + run: ../mvnw -B clean package -T2C + working-directory: src + - name: Check for uncommited changes run: | if [[ "$(git status --porcelain)" != "" ]]; then @@ -60,6 +55,8 @@ jobs: runs-on: ubuntu-latest needs: [check-code] timeout-minutes: 10 + permissions: + contents: write outputs: upload_url: ${{ steps.create-release.outputs.upload_url }} steps: @@ -76,10 +73,9 @@ jobs: - name: Get version id: version run: | - version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + version=$(./mvnw -B help:evaluate -Dexpression=project.version -q -DforceStdout) echo "release=$version" >> $GITHUB_OUTPUT echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Commit and Push run: | @@ -91,7 +87,7 @@ jobs: - name: Create Release id: create-release - uses: shogo82148/actions-create-release@6a396031bc74c57403da1018fec74d24c6aa03cd # v1 + uses: shogo82148/actions-create-release@8674c0ecee617c8dfb006526bcc22a362c70b88a # v1 with: tag_name: v${{ steps.version.outputs.release }} release_name: v${{ steps.version.outputs.release }} @@ -105,7 +101,7 @@ jobs: ```XML software.xdev - ${{ env.PRIMARY_MAVEN_MODULE }} + ${{ github.event.repository.name }} ${{ steps.version.outputs.release }} ``` @@ -124,41 +120,41 @@ jobs: git pull - name: Set up JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: # running setup-java overwrites the settings.xml distribution: 'temurin' java-version: '17' server-id: github-central - server-password: PACKAGES_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-password-env-var: PACKAGES_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once - name: Publish to GitHub Packages Central - run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B deploy -P publish -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central + working-directory: src env: PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - name: Set up JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: # running setup-java again overwrites the settings.xml distribution: 'temurin' java-version: '17' server-id: sonatype-central-portal - server-username: MAVEN_CENTRAL_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-username-env-var: MAVEN_CENTRAL_USERNAME + server-password-env-var: MAVEN_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE - name: Publish to Central Portal - run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests + run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal + working-directory: src env: MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - publish-pages: + build-pages: runs-on: ubuntu-latest needs: [prepare-release] timeout-minutes: 15 @@ -172,7 +168,7 @@ jobs: git pull - name: Setup - Java - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: java-version: '17' distribution: 'temurin' @@ -187,20 +183,69 @@ jobs: ${{ runner.os }}-mvn-build- - name: Build site - run: ../mvnw -B compile site -DskipTests -T2C - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - - - name: Deploy to Github pages - uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4 + run: ../mvnw -B compile site -P site -T2C + working-directory: src + + - name: Aggregate site + run: | + # Compile is required, otherwise dep resolution failure + echo "Looking up modules" + module_dirs=($(../mvnw -B -q --also-make compile exec:exec -Dexec.executable="pwd" -Dmaven.main.skip)) + base_module_full="${module_dirs[0]}" + + echo "Found modules - Src: $base_module_full" + + base_cut_away_length=$((${#base_module_full}+1)) + + echo "BasePathLengthToCutAway: $base_cut_away_length" + + is_first=true + for full_module_path in "${module_dirs[@]}" + do + if [ $is_first = true ]; then + echo "Skipping initial/base module" + is_first=false + continue + fi + + m=${full_module_path:$base_cut_away_length} + + echo "$m/target/site/. -> ./target/site/$m" + mkdir -p ./target/site/$m + cp -r $m/target/site/. ./target/site/$m + done + working-directory: src + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v5 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site - force_orphan: true + path: src/target/site + + deploy-pages: + runs-on: ubuntu-latest + needs: [build-pages] + timeout-minutes: 10 + concurrency: + group: 'pages' + cancel-in-progress: false + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 after-release: runs-on: ubuntu-latest needs: [publish-maven] timeout-minutes: 10 + permissions: + contents: write + pull-requests: write steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 96e5d2a7..382f6567 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -3,9 +3,6 @@ name: Test Deployment on: workflow_dispatch: -env: - PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - jobs: publish-maven: runs-on: ubuntu-latest @@ -14,35 +11,35 @@ jobs: - uses: actions/checkout@v7 - name: Set up JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: # running setup-java overwrites the settings.xml distribution: 'temurin' java-version: '17' server-id: github-central - server-password: PACKAGES_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-password-env-var: PACKAGES_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once - name: Publish to GitHub Packages Central - run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B deploy -P publish -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central + working-directory: src env: PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - name: Set up JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: # running setup-java again overwrites the settings.xml distribution: 'temurin' java-version: '17' server-id: sonatype-central-portal - server-username: MAVEN_CENTRAL_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-username-env-var: MAVEN_CENTRAL_USERNAME + server-password-env-var: MAVEN_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE - name: Publish to Central Portal - run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal + working-directory: src env: MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} diff --git a/.idea/PMDPlugin.xml b/.idea/PMDPlugin.xml deleted file mode 100644 index 0936e518..00000000 --- a/.idea/PMDPlugin.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml index 3dbbcc7a..b8b753e6 100644 --- a/.idea/checkstyle-idea.xml +++ b/.idea/checkstyle-idea.xml @@ -1,7 +1,7 @@ - 13.5.0 + latest JavaOnlyWithTests true true diff --git a/.idea/pmd-x.xml b/.idea/pmd-x.xml index 260e454b..7b3b48fa 100644 --- a/.idea/pmd-x.xml +++ b/.idea/pmd-x.xml @@ -10,6 +10,7 @@ diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index 7f339b84..ab7fd797 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -2,7 +2,6 @@