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,50 +2,41 @@
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 cd "${project}"
./scripts/setup.sh client "${ARCH}" -DMCPI_HEADLESS_MODE=ON rm -rf build
./scripts/build.sh client "${ARCH}" mkdir build
cd build
# Add minecraft-pi-reborn-client To PATH cmake -GNinja ..
export PATH="$(pwd)/out/client-$(dpkg-architecture -qDEB_BUILD_ARCH)/usr/bin:${PATH}" cmake --build .
cd ../../../
# Skip Root Check done
export _MCPI_SKIP_ROOT_CHECK=1 fi
# 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}"
rm -rf build
mkdir build
cd build
cmake -GNinja ..
cmake --build .
cd ../../../
done