mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-15 04:30:29 +00:00
020c5cd2d3
In classic squid tradition: 20% code, and 80% test logic. Closes #962. Alas, whoever reported this has deleted their account, so they can't even be happy about it :(.
93 lines
2.1 KiB
YAML
93 lines
2.1 KiB
YAML
name: Build
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
|
|
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: Disable Gradle daemon
|
|
run: |
|
|
mkdir -p ~/.gradle
|
|
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
|
|
|
- name: Build with Gradle
|
|
run: |
|
|
./gradlew assemble || ./gradlew assemble
|
|
./gradlew downloadAssets || ./gradlew downloadAssets
|
|
./gradlew build
|
|
|
|
- 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: Upload Jar
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: CC-Tweaked
|
|
path: projects/forge/build/libs
|
|
|
|
- name: Upload coverage
|
|
uses: codecov/codecov-action@v3
|
|
|
|
- name: Parse test reports
|
|
run: ./tools/parse-reports.py
|
|
if: ${{ failure() }}
|
|
|
|
- name: Run linters
|
|
uses: pre-commit/action@v3.0.0
|
|
|
|
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
|
|
run: python3 ./tools/parse-reports.py
|
|
if: ${{ failure() }}
|