This commit is contained in:
TheBrokenRail 2023-12-26 17:29:45 -05:00
parent ac55d7d6b3
commit 5f8c700081
2 changed files with 41 additions and 41 deletions

View File

@ -47,6 +47,12 @@ jobs:
path: ./out/*.AppImage* path: ./out/*.AppImage*
# Test Project # Test Project
test: test:
strategy:
fail-fast: false
matrix:
mode:
- Client
- Server
name: Test name: Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:16-buster container: node:16-buster
@ -63,9 +69,12 @@ jobs:
apt-get install --no-install-recommends -y -t buster-backports cmake apt-get install --no-install-recommends -y -t buster-backports cmake
- name: Install Dependencies - name: Install Dependencies
run: ./scripts/install-dependencies.sh run: ./scripts/install-dependencies.sh
- name: Install ARM Toolchain
if: ${{ matrix.mode == 'Client' }}
run: apt-get install --no-install-recommends -y g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
# Test # Test
- name: Test - name: Test
run: ./scripts/test.sh run: ./scripts/test.sh ${{ matrix.mode }}
# Create Release # Create Release
release: release:
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')

View File

@ -2,45 +2,35 @@
set -e set -e
## Server Test # Variables
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
# Build Test
ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)" ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)"
./scripts/setup.sh server "${ARCH}"
./scripts/build.sh server "${ARCH}"
# Add minecraft-pi-reborn-server To PATH # Build
export PATH="$(pwd)/out/server-$(dpkg-architecture -qDEB_BUILD_ARCH)/usr/bin:${PATH}" ./scripts/setup.sh "${MODE}" "${ARCH}" -DMCPI_HEADLESS_MODE=ON
./scripts/build.sh "${MODE}" "${ARCH}"
# Create Test Directory # Add To PATH
export PATH="$(pwd)/out/${MODE}-${ARCH}/usr/bin:${PATH}"
# Make Test Directory
rm -rf build/test rm -rf build/test
mkdir -p build/test mkdir -p build/test
# Run Test # Run
cd build/test if [ "${MODE}" = "server" ]; then
minecraft-pi-reborn-server --only-generate # Server Test
cd ../../ cd build/test
minecraft-pi-reborn-server --only-generate
cd ../../
else
# Client Test
export _MCPI_SKIP_ROOT_CHECK=1
export HOME="$(pwd)/build/test"
minecraft-pi-reborn-client --default --no-cache --benchmark
## Client Test # Build Example Mods
for project in example-mods/*/; do
# Build Benchmark
./scripts/setup.sh client "${ARCH}" -DMCPI_HEADLESS_MODE=ON
./scripts/build.sh client "${ARCH}"
# Add minecraft-pi-reborn-client To PATH
export PATH="$(pwd)/out/client-$(dpkg-architecture -qDEB_BUILD_ARCH)/usr/bin:${PATH}"
# Skip Root Check
export _MCPI_SKIP_ROOT_CHECK=1
# Run Benchmark
export HOME="$(pwd)/build/test"
minecraft-pi-reborn-client --default --no-cache --benchmark
## Example Mods Test
# Build
for project in example-mods/*/; do
cd "${project}" cd "${project}"
rm -rf build rm -rf build
mkdir build mkdir build
@ -48,4 +38,5 @@ for project in example-mods/*/; do
cmake -GNinja .. cmake -GNinja ..
cmake --build . cmake --build .
cd ../../../ cd ../../../
done done
fi