Skip to content

Change cached gradle home contents #22

Change cached gradle home contents

Change cached gradle home contents #22

Workflow file for this run

name: Snapshot
concurrency: ci-${{ github.ref }}
on:
workflow_dispatch:
push:
branches:
- 1.*
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Setup Java
run: |
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: fregante/setup-git-user@v2
- uses: actions/cache@v3
with:
path: |
**/.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- uses: gradle/gradle-build-action@v2
name: Setup Gradle
with:
gradle-home-cache-cleanup: true
gradle-home-cache-includes: |
caches/fabric-loom
gradle-home-cache-excludes: |
caches/build-cache-1
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
- name: Build
id: build
run: |
./gradlew build
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
BUILD_CACHE_URL: ${{ secrets.BUILD_CACHE_URL }}
BUILD_CACHE_USER: ${{ secrets.BUILD_CACHE_USER }}
BUILD_CACHE_PASSWORD: ${{ secrets.BUILD_CACHE_PASSWORD }}
- name: Test - Fabric
if: (success() || failure()) && steps.build.conclusion == 'success'
run: |
./gradlew :fabric:runGametest
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
- name: Test - NeoForge
if: (success() || failure()) && steps.build.conclusion == 'success'
run: |
./gradlew :neoforge:runGametest
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
- name: Move Test Results
run: |
mkdir -p tests/
[[ -f fabric/build/gametest/build/junit.xml ]] && cp fabric/build/gametest/build/junit.xml tests/gametests-fabric.xml || echo "Fabric gametest results not present"
[[ -f neoforge/build/gametest/build/junit.xml ]] && cp neoforge/build/gametest/build/junit.xml tests/gametests-neoforge.xml || echo "NeoForge gametest results not present"
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: junit-test-results
path: tests
retention-days: 1
- name: Publish
run: |
./gradlew publish
env:
MAVEN_USER: github
MAVEN_PASSWORD: ${{ secrets.SNAPSHOT_MAVEN_PASSWORD }}
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
BUILD_CACHE_URL: ${{ secrets.BUILD_CACHE_URL }}
BUILD_CACHE_USER: ${{ secrets.BUILD_CACHE_USER }}
BUILD_CACHE_PASSWORD: ${{ secrets.BUILD_CACHE_PASSWORD }}