-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.75 KB
/
build_and_test.yml
File metadata and controls
66 lines (55 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Build and test the mod
name: Build and test
on:
workflow_dispatch:
inputs:
timeout:
description: 'Timeout for runServer (seconds)'
required: false
default: 90
type: number
client-only:
description: 'Do not execute runServer'
required: false
default: false
type: boolean
concurrency:
group: build-and-test-${{ inputs.target_branch || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
ref: ${{ inputs.target_branch || github.ref }}
- name: Setup Build
uses: ./.github/actions/build_setup
- name: Compile the mod
run: ./gradlew --info --scan --stacktrace assemble
- name: Upload Jars
uses: actions/upload-artifact@v7
with:
name: AdvancedBackups-Patch
path: build/libs/*.jar
retention-days: 31
- name: Run post-build checks
id: build_mod
run: ./gradlew --info build
- name: Run server for ${{ inputs.timeout }} seconds
if: ${{ !inputs.client-only }}
run: |
mkdir -p run/server/
echo "eula=true" > run/server/eula.txt
# Set a constant seed with a village at spawn
echo "stop" > run/server/stop.txt
timeout ${{ inputs.timeout }} ./gradlew runServer 2>&1 < run/server/stop.txt | tee -a server.log || true
- name: Test no errors reported during server run
if: ${{ !inputs.client-only }}
run: |
chmod +x ./scripts/test_no_error_reports.sh
./scripts/test_no_error_reports.sh