Fix CI
This commit is contained in:
parent
ac55d7d6b3
commit
5f8c700081
@ -47,6 +47,12 @@ jobs:
|
||||
path: ./out/*.AppImage*
|
||||
# Test Project
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
mode:
|
||||
- Client
|
||||
- Server
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
container: node:16-buster
|
||||
@ -63,9 +69,12 @@ jobs:
|
||||
apt-get install --no-install-recommends -y -t buster-backports cmake
|
||||
- name: Install Dependencies
|
||||
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
|
||||
- name: Test
|
||||
run: ./scripts/test.sh
|
||||
run: ./scripts/test.sh ${{ matrix.mode }}
|
||||
# Create Release
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
@ -2,50 +2,41 @@
|
||||
|
||||
set -e
|
||||
|
||||
## Server Test
|
||||
|
||||
# Build Test
|
||||
# Variables
|
||||
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
|
||||
ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)"
|
||||
./scripts/setup.sh server "${ARCH}"
|
||||
./scripts/build.sh server "${ARCH}"
|
||||
|
||||
# Add minecraft-pi-reborn-server To PATH
|
||||
export PATH="$(pwd)/out/server-$(dpkg-architecture -qDEB_BUILD_ARCH)/usr/bin:${PATH}"
|
||||
# Build
|
||||
./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
|
||||
mkdir -p build/test
|
||||
|
||||
# Run Test
|
||||
cd build/test
|
||||
minecraft-pi-reborn-server --only-generate
|
||||
cd ../../
|
||||
# Run
|
||||
if [ "${MODE}" = "server" ]; then
|
||||
# Server Test
|
||||
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 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}"
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja ..
|
||||
cmake --build .
|
||||
cd ../../../
|
||||
done
|
||||
# Build Example Mods
|
||||
for project in example-mods/*/; do
|
||||
cd "${project}"
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja ..
|
||||
cmake --build .
|
||||
cd ../../../
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user