2019-09-27 07:56:53 +00:00
|
|
|
name: Build
|
2019-09-14 08:16:13 +00:00
|
|
|
|
2019-09-30 14:37:52 +00:00
|
|
|
on: [push, pull_request]
|
2019-09-14 08:16:13 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2019-12-03 23:26:13 +00:00
|
|
|
name: Build
|
2019-09-14 08:16:13 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-10-22 20:21:33 +00:00
|
|
|
- name: Clone repository
|
|
|
|
uses: actions/checkout@v3
|
2019-09-14 08:16:13 +00:00
|
|
|
|
2022-10-22 20:21:33 +00:00
|
|
|
- name: Set up Java
|
|
|
|
uses: actions/setup-java@v3
|
2019-09-14 08:16:13 +00:00
|
|
|
with:
|
2022-10-25 21:36:21 +00:00
|
|
|
java-version: 17
|
2022-10-22 20:21:33 +00:00
|
|
|
distribution: 'temurin'
|
2019-09-14 08:16:13 +00:00
|
|
|
|
2022-10-22 20:21:33 +00:00
|
|
|
- name: Setup Gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
2020-02-08 11:17:45 +00:00
|
|
|
with:
|
2022-10-22 20:21:33 +00:00
|
|
|
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
|
2020-02-08 11:17:45 +00:00
|
|
|
|
2021-04-28 20:24:27 +00:00
|
|
|
- name: Disable Gradle daemon
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.gradle
|
|
|
|
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
|
|
|
|
2019-09-14 08:16:13 +00:00
|
|
|
- name: Build with Gradle
|
2021-01-09 19:50:27 +00:00
|
|
|
run: |
|
2021-04-28 20:24:27 +00:00
|
|
|
./gradlew assemble || ./gradlew assemble
|
|
|
|
./gradlew downloadAssets || ./gradlew downloadAssets
|
2022-09-11 13:11:32 +00:00
|
|
|
./gradlew build
|
2021-01-09 19:50:27 +00:00
|
|
|
|
2022-11-18 23:57:25 +00:00
|
|
|
- name: Run client tests
|
|
|
|
run: ./gradlew runGametestClient # Not checkClient, as no point running rendering tests.
|
2022-11-25 20:44:44 +00:00
|
|
|
# These are a little flaky on GH actions: its useful to run them, but don't break the build.
|
|
|
|
continue-on-error: true
|
2022-11-18 23:57:25 +00:00
|
|
|
|
2023-01-01 15:04:25 +00:00
|
|
|
- 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"' \;
|
|
|
|
|
2020-01-01 00:08:31 +00:00
|
|
|
- name: Upload Jar
|
2022-12-04 18:41:19 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-01-01 00:08:31 +00:00
|
|
|
with:
|
|
|
|
name: CC-Tweaked
|
2023-01-01 15:04:25 +00:00
|
|
|
path: ./jars
|
2020-01-01 00:08:31 +00:00
|
|
|
|
2022-09-11 13:11:32 +00:00
|
|
|
- name: Upload coverage
|
2022-12-04 18:41:19 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
2021-05-17 16:31:58 +00:00
|
|
|
|
|
|
|
- name: Parse test reports
|
|
|
|
run: ./tools/parse-reports.py
|
|
|
|
if: ${{ failure() }}
|
2020-05-11 14:41:39 +00:00
|
|
|
|
2021-04-28 20:24:27 +00:00
|
|
|
- name: Run linters
|
2022-09-11 13:11:32 +00:00
|
|
|
uses: pre-commit/action@v3.0.0
|
2022-12-04 18:41:19 +00:00
|
|
|
|
|
|
|
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@v3
|
|
|
|
|
|
|
|
- name: Set up Java
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: 17
|
|
|
|
distribution: 'temurin'
|
|
|
|
|
|
|
|
- name: Setup Gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
./gradlew --configure-on-demand :core:test
|
|
|
|
|
|
|
|
- name: Parse test reports
|
2022-12-04 21:59:30 +00:00
|
|
|
run: python3 ./tools/parse-reports.py
|
2022-12-04 18:41:19 +00:00
|
|
|
if: ${{ failure() }}
|