Add compatibility for minecraft version 1.21.1, 1.21.2, 1.21.3, 1.21.… #6
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: Build and Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| - 'master_*' | |
| - 'develop_*' | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| - 'master_*' | |
| - 'develop_*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build --no-daemon | |
| - name: Run Unit Tests | |
| run: ./gradlew test --no-daemon | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: build/reports/tests/ | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mod-jar | |
| path: build/libs/*.jar | |
| gametest: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run GameTests | |
| run: ./gradlew runGameTestServer --no-daemon | |
| - name: Upload GameTest Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: gametest-results | |
| path: | | |
| logs/ | |
| run/logs/ |