Latest Minecraft version #1363
This file contains hidden or 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: Check Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ dev ] | |
| paths-ignore: | |
| - '**.md' | |
| - '.config/**' | |
| - '.github/**' | |
| - '.idea/**' | |
| - '.run/**' | |
| - 'assets/**' | |
| pull_request: | |
| branches: [ dev ] | |
| paths-ignore: | |
| - '**.md' | |
| - '.config/**' | |
| - '.github/**' | |
| - '.idea/**' | |
| - '.run/**' | |
| - 'assets/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| java: [25] | |
| distribution: [temurin] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: ${{ matrix.distribution }} | |
| java-version: ${{ matrix.java }} | |
| - name: Cache Gradle | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-build- | |
| - name: Build | |
| run: ./gradlew build --info --stacktrace | |
| - name: Check for uncommited changes | |
| run: | | |
| if [[ "$(git status --porcelain)" != "" ]]; then | |
| echo ---------------------------------------- | |
| echo git status | |
| echo ---------------------------------------- | |
| git status | |
| echo ---------------------------------------- | |
| echo git diff | |
| echo ---------------------------------------- | |
| git diff | |
| echo ---------------------------------------- | |
| echo Troubleshooting | |
| echo ---------------------------------------- | |
| echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package" | |
| exit 1 | |
| fi | |
| - name: Upload mod files | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: mod-files-java-${{ matrix.java }} | |
| path: | | |
| build/devlibs/*-sources.jar | |
| build/libs/*.jar | |
| !build/libs/*-sources.jar | |
| !build/libs/*-javadoc.jar | |
| if-no-files-found: error | |
| checkstyle: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'pull_request' || !(startsWith(github.head_ref, 'renovate/') || startsWith(github.head_ref, 'automated/')) }} | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| java: [25] | |
| distribution: [temurin] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: ${{ matrix.distribution }} | |
| java-version: ${{ matrix.java }} | |
| - name: Cache Gradle | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-checkstyle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-checkstyle- | |
| - name: Run Checkstyle | |
| run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled=true | |
| pmd: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'pull_request' || !(startsWith(github.head_ref, 'renovate/') || startsWith(github.head_ref, 'automated/')) }} | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| java: [25] | |
| distribution: [temurin] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: ${{ matrix.distribution }} | |
| java-version: ${{ matrix.java }} | |
| - name: Cache Gradle | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-pmd-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-pmd- | |
| - name: Run PMD | |
| run: ./gradlew pmdMain pmdTest -PpmdEnabled --stacktrace | |
| - name: Upload report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pmd-report | |
| if-no-files-found: ignore | |
| path: | | |
| build/reports/pmd/*.html |