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:
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: 📥 Clone repository
|
2022-10-22 20:21:33 +00:00
|
|
|
uses: actions/checkout@v3
|
2019-09-14 08:16:13 +00:00
|
|
|
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: 📥 Set up Java
|
2022-10-22 20:21:33 +00:00
|
|
|
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
|
|
|
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: 📥 Setup Gradle
|
2022-10-22 20:21:33 +00:00
|
|
|
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
|
|
|
|
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: ⚒️ Build
|
2023-06-29 21:31:49 +00:00
|
|
|
run: ./gradlew assemble || ./gradlew assemble
|
|
|
|
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: 💡 Lint
|
|
|
|
uses: pre-commit/action@v3.0.0
|
|
|
|
|
|
|
|
- name: 🧪 Run tests
|
|
|
|
run: ./gradlew test validateMixinNames checkChangelog
|
|
|
|
|
|
|
|
- name: 📥 Download assets for game tests
|
2023-06-29 21:31:49 +00:00
|
|
|
run: ./gradlew downloadAssets || ./gradlew downloadAssets
|
|
|
|
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: 🧪 Run integration tests
|
|
|
|
run: ./gradlew runGametest
|
2021-01-09 19:50:27 +00:00
|
|
|
|
2023-07-05 19:57:56 +00:00
|
|
|
- name: 🧪 Run client tests
|
2022-11-18 23:57:25 +00:00
|
|
|
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-07-05 19:57:56 +00:00
|
|
|
- name: 🧪 Parse test reports
|
|
|
|
run: ./tools/parse-reports.py
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
|
|
|
- name: 📦 Prepare Jars
|
2023-01-01 15:04:25 +00:00
|
|
|
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"' \;
|
|
|
|
|
2023-07-05 19:57:56 +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
|
|
|
|
2023-07-05 19:57:56 +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
|
|
|
|
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() }}
|