π·π» add build time step #5
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 Status | |
| on: | |
| push: | |
| branches: [ '*' ] | |
| pull_request: | |
| env: | |
| JAVA_VERSION: 25 | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get time of build | |
| id: time | |
| run: echo BUILD_TIME=$(date -u --iso-8601=seconds) >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ env.JAVA_VERSION }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'microsoft' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_CONFIG_CACHE_ENCRYPTION_KEY }} | |
| - name: Grant Gradle execute permissions | |
| run: chmod +x ./gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew assemble | |
| env: | |
| BUILD_TIME: ${{ steps.time.outputs.BUILD_TIME }} | |
| - name: Upload build artifacts (Common) | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ github.event.repository.name }}-Common-${{ github.sha }} | |
| path: | | |
| Common/build/libs/*.jar | |
| - name: Upload build artifacts (NeoForge) | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ github.event.repository.name }}-NeoForge-${{ github.sha }} | |
| path: | | |
| NeoForge/build/libs/*.jar | |
| - name: Upload build artifacts (Fabric) | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ github.event.repository.name }}-Fabric-${{ github.sha }} | |
| path: | | |
| Fabric/build/libs/*.jar | |
| - name: Run tests | |
| run: ./gradlew check | |
| env: | |
| BUILD_TIME: ${{ steps.time.outputs.BUILD_TIME }} | |
| # - name: Publish Test Report | |
| # uses: mikepenz/action-junit-report@ee6b445351cd81e2f73a16a0e52d598aeac2197f # v5.3.0 | |
| # if: success() || failure() # always run even if the previous step fails | |
| # with: | |
| # report_paths: '**/build/test-results/test/TEST-*.xml' |