Skip to content

Commit

Permalink
maven (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
bombcar authored Feb 12, 2022
1 parent 3363828 commit 90a3beb
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 136 deletions.
9 changes: 0 additions & 9 deletions .github/scripts/test-no-crash-reports.sh

This file was deleted.

33 changes: 33 additions & 0 deletions .github/scripts/test-no-error-reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

RUNDIR="run"
CRASH="crash-reports"
SERVERLOG="server.log"

if [[ -d $RUNDIR/$CRASH ]]; then
echo "Crash reports detected:"
cat $RUNDIR/$CRASH/crash*.txt
exit 1
fi

if grep --quiet "Fatal errors were detected" $SERVERLOG; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi

if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
echo "Server force stopped:"
cat server.log
exit 1
fi

if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi

echo "No crash reports detected"
exit 0

20 changes: 10 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
with:
fetch-depth: 0

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Setup the workspace
run: ./gradlew setupCIWorkspace

- name: Build the mod
run: ./gradlew build

- name: Run server for 1 minute
- name: Run server for 1.5 minutes
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 10 ./gradlew runServer || true
echo "eula=true" > run/eula.txt
timeout 90 ./gradlew runServer 2>&1 | tee -a server.log || true
- name: Test no crashes happend
- name: Test no errors reported during server run
run: |
chmod +x .github/scripts/test-no-crash-reports.sh
.github/scripts/test-no-crash-reports.sh
chmod +x .github/scripts/test-no-error-reports.sh
.github/scripts/test-no-error-reports.sh
71 changes: 28 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,47 +1,32 @@
/bin/
#General use .gitignore for Minecraft modding.

#Folders
/.gradle/*
/build/*
/eclipse/*
/run/*
/out/*
/asm/*
/bin/*
/download/*
/.settings/*
/debug/*
/.metadata/*
/config/*
/logs/*
/saves/*
.gradle
.settings
/.idea/

#File Extensions
*.psd
/.vscode/
/run/
/build/
/eclipse/
.classpath
.project
/bin/
/config/
/crash-reports/
/logs/
options.txt
/saves/
usernamecache.json
banned-ips.json
banned-players.json
eula.txt
ops.json
server.properties
servers.dat
usercache.json
whitelist.json
/out/
*.iml
*.ipr
*.iws
*.classpath
*.project
*.lock
*.log

#Specific files
MCFPost.txt
options.txt

#Remove OS generated garbage
*/.DS_Store
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

#Vim backups
*~
*.bat
src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
Loading

0 comments on commit 90a3beb

Please sign in to comment.