Skip to content

Replace mutable list usages with TreeList in stack operations #1081

Replace mutable list usages with TreeList in stack operations

Replace mutable list usages with TreeList in stack operations #1081

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:
merge_group:
workflow_dispatch:
# trigger on pushes to the default branch (main) to keep the cache up to date
push:
branches: indev/1.21.1
env:
JAVA_VERSION: '21.0.5'
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: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v4
- name: Build
run: |
chmod +x gradlew
./gradlew build
- name: Prepare artifacts for upload
run: |
mkdir -p dist
cp {Common,Neoforge,Fabric}/build/libs/*.jar dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: mod-build
path: dist
retention-days: 30
test:
needs: build
strategy:
fail-fast: false
matrix:
env:
- server
- client
modloader:
- fabric
- neoforge
include:
- modloader: fabric
mc-runtime-test: fabric
fabric-api: 0.116.12
dependencies: >-
'https://cdn.modrinth.com/data/Ha28R6CL/versions/2i87JpYj/fabric-language-kotlin-1.13.11%2Bkotlin.2.3.21.jar'
'https://cdn.modrinth.com/data/9s6osm5g/versions/HpMb5wGb/cloth-config-15.0.140-fabric.jar'
'https://github.com/SuperKnux/HexMod/raw/refs/heads/indev/1.21.1/libs/paucal-0.7.1-noelle+1.21.1-fabric.jar'
'https://cdn.modrinth.com/data/fin1PX4m/versions/SBDJBD0a/inline-fabric-1.21.1-1.2.2.jar'
'https://cdn.modrinth.com/data/K01OU20C/versions/nLsCe2VD/cardinal-components-api-6.1.3.jar'
'https://cdn.modrinth.com/data/nU0bVIaL/versions/XIjNwQkI/Patchouli-1.21.1-93-FABRIC.jar'
'https://cdn.modrinth.com/data/mOgUt4GM/versions/v6Xx3fbU/modmenu-11.0.4.jar'
'https://cdn.modrinth.com/data/5aaWibi9/versions/JagCscwi/trinkets-3.10.0.jar'
- modloader: neoforge
mc-runtime-test: neoforge
fabric-api: none
dependencies: >-
'https://cdn.modrinth.com/data/ordsPcFz/versions/NrSebcsG/kotlinforforge-5.11.0-all.jar'
'https://cdn.modrinth.com/data/9s6osm5g/versions/izKINKFg/cloth-config-15.0.140-neoforge.jar'
'https://github.com/SuperKnux/HexMod/raw/refs/heads/indev/1.21.1/libs/paucal-0.7.1-noelle+1.21.1-neoforge.jar'
'https://cdn.modrinth.com/data/fin1PX4m/versions/FhE1RJsR/inline-neoforge-1.21.1-1.2.2.jar'
'https://cdn.modrinth.com/data/nU0bVIaL/versions/BIogJv2D/Patchouli-1.21.1-93-NEOFORGE.jar'
'https://cdn.modrinth.com/data/lhGA9TYQ/versions/ZxYGwlk0/architectury-13.0.8-neoforge.jar'
'https://cdn.modrinth.com/data/40FYwb4z/versions/KsfI4QsR/caelus-neoforge-7.0.1%2B1.21.1.jar'
'https://cdn.modrinth.com/data/vvuO3ImH/versions/yohfFbgD/curios-neoforge-9.5.1%2B1.21.1.jar'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- name: Create cache key
run: |
cat <<END_OF_FILE > dependencies.txt
${{ matrix.dependencies }}
END_OF_FILE
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: run/mods
key: ${{ hashFiles('dependencies.txt') }}
- name: Download dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
for url in ${{ matrix.dependencies }}; do
wget --directory-prefix=run/mods/ "$url"
done
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: mod-build
path: dist
- name: Prepare mod jar
run: |
rm -f dist/*-javadoc.jar dist/*-sources.jar
cp dist/hexcasting-${{ matrix.modloader }}-*.jar run/mods
- name: Run MC test client
if: matrix.env == 'client'
timeout-minutes: 10
uses: headlesshq/mc-runtime-test@4.4.0
with:
java: ${{ env.JAVA_VERSION }}
mc: 1.21.1
modloader: ${{ matrix.modloader }}
regex: '.*${{ matrix.modloader }}.*'
fabric-api: ${{ matrix.fabric-api }}
mc-runtime-test: ${{ matrix.mc-runtime-test }}
- name: Run MC test server
if: matrix.env == 'server'
timeout-minutes: 10
uses: headlesshq/mc-server-test@1.1.1
with:
java: 21
mc: 1.21.1
modloader: ${{ matrix.modloader }}
fabric-api: ${{ matrix.fabric-api }}
datagen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v4
# 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: |
chmod +x gradlew
./gradlew runAllDatagen
- name: Check datagen
run: |
git add --intent-to-add .
git diff --name-only --exit-code -- ":!:*/src/generated/resources/.cache/*"
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/actions/.github/workflows/hexdoc.yml@v1
permissions:
contents: write
pages: read
secrets:
GH_TOKEN: ""
with:
python-version: "3.11"
release: false
deploy-pages: false
site-url: https://hexcasting.hexxy.media