Skip to content

Fix PR workflow caching and upload build artifacts #106

Fix PR workflow caching and upload build artifacts

Fix PR workflow caching and upload build artifacts #106

Workflow file for this run

# mirror of the Jenkins pipeline, used for requiring PRs to build successfully before merging
# this uses Actions because it's easier to integrate with GitHub PRs, and to allow running the build on forks
name: Build pull request
on:
pull_request:
workflow_dispatch:
# trigger on pushes to the default branch (main) to keep the cache up to date
push:
branches: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17.0.1"
- uses: gradle/actions/setup-gradle@v3
- name: Build
run: |
chmod +x gradlew
./gradlew build
# ForgeGradle datagen asset download often fails (see #692)
# so just allow it to automatically retry a few times
- name: Run Datagen
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: ./gradlew runAllDatagen
- name: Check Datagen
run: |
git add --intent-to-add .
git diff --name-only --exit-code -- ":!:*/src/generated/resources/.cache/*"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: |
Common/build/libs/*.jar
Forge/build/libs/*.jar
Fabric/build/libs/*.jar
hexdoc:
# don't bother running the docs build when pushing to main - nothing necessary to cache here
if: github.event_name != 'push'
uses: hexdoc-dev/hexdoc/.github/workflows/hexdoc.yml@main
permissions:
contents: write
pages: read
secrets:
GH_TOKEN: ""
with:
python-version: "3.11"
release: false
deploy-pages: false
site-url: https://hexcasting.hexxy.media