name: Build on: [push, pull_request] jobs: build: name: Build runs-on: ubuntu-latest steps: - name: ๐Ÿ“ฅ Clone repository uses: actions/checkout@v4 - name: ๐Ÿ“ฅ Set up Java uses: actions/setup-java@v4 with: java-version: 21 distribution: 'temurin' - name: ๐Ÿ“ฅ Setup Gradle uses: gradle/actions/setup-gradle@v3 with: cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }} - name: Disable Gradle daemon run: | mkdir -p ~/.gradle echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties - name: โš’๏ธ Build run: ./gradlew assemble || ./gradlew assemble - name: ๐Ÿ’ก Lint uses: pre-commit/action@v3.0.0 - name: ๐Ÿงช Run tests run: ./gradlew test validateMixinNames checkChangelog - name: ๐Ÿ“ฅ Download assets for game tests run: ./gradlew downloadAssets || ./gradlew downloadAssets - name: ๐Ÿงช Run integration tests run: ./gradlew runGametest - name: ๐Ÿงช Run client tests run: ./gradlew runGametestClient # Not checkClient, as no point running rendering tests. # These are a little flaky on GH actions: its useful to run them, but don't break the build. continue-on-error: true - name: ๐Ÿงช Parse test reports run: ./tools/parse-reports.py if: ${{ failure() }} - name: ๐Ÿ“ฆ Prepare Jars run: | # Find the main jar and append the git hash onto it. mkdir -p jars find projects/forge/build/libs projects/fabric/build/libs -type f -regex '.*[0-9.]+\(-SNAPSHOT\)?\.jar$' -exec bash -c 'cp {} "jars/$(basename {} .jar)-$(git rev-parse HEAD).jar"' \; - name: ๐Ÿ“ค Upload Jar uses: actions/upload-artifact@v4 with: name: CC-Tweaked path: ./jars - name: ๐Ÿ“ค Upload coverage uses: codecov/codecov-action@v4 build-core: strategy: fail-fast: false matrix: include: - name: Windows uses: windows-latest - name: macOS uses: macos-latest name: Test on ${{ matrix.name }} runs-on: ${{ matrix.uses }} steps: - name: ๐Ÿ“ฅ Clone repository uses: actions/checkout@v4 - name: ๐Ÿ“ฅ Set up Java uses: actions/setup-java@v4 with: java-version: 21 distribution: 'temurin' - name: ๐Ÿ“ฅ Setup Gradle uses: gradle/actions/setup-gradle@v3 with: cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }} - name: โš’๏ธ Build run: | ./gradlew --configure-on-demand :core:assemble - name: ๐Ÿงช Run tests run: | ./gradlew --configure-on-demand :core:test - name: ๐Ÿงช Parse test reports run: python3 ./tools/parse-reports.py if: ${{ failure() }}