aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build-and-test.yml
diff options
context:
space:
mode:
authorJohann Bernhardt <johann.bernhardt@tum.de>2021-12-02 19:59:50 +0100
committerGitHub <noreply@github.com>2021-12-02 19:59:50 +0100
commitaf3a51c0a8cd24a86175df8d999a79f01eb09105 (patch)
treed074e2d3901a751cca3d8153bb48aa2145b23984 /.github/workflows/build-and-test.yml
parent3b5f58e4da7b186fd628b3dbcb88b5393e8ceac0 (diff)
downloadGT5-Unofficial-af3a51c0a8cd24a86175df8d999a79f01eb09105.tar.gz
GT5-Unofficial-af3a51c0a8cd24a86175df8d999a79f01eb09105.tar.bz2
GT5-Unofficial-af3a51c0a8cd24a86175df8d999a79f01eb09105.zip
Migrate to unified build script (#59)
Former-commit-id: 9b48b72af5e2885baffbe3f89984364d99bc58d4
Diffstat (limited to '.github/workflows/build-and-test.yml')
-rw-r--r--.github/workflows/build-and-test.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 0000000000..a60a2b6468
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,45 @@
+# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
+
+name: Build and test
+
+on:
+ pull_request:
+ branches: [ master, main ]
+ push:
+ branches: [ master, main ]
+
+jobs:
+ build-and-test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ 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
+ run: |
+ mkdir run
+ echo "eula=true" > run/eula.txt
+ timeout 60 ./gradlew runServer || true
+
+ - name: Test no crashes happend
+ run: |
+ chmod +x .github/scripts/test-no-crash-reports.sh
+ .github/scripts/test-no-crash-reports.sh