-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (70 loc) · 2.29 KB
/
test.yml
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
67
68
69
70
71
72
73
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build and test
on: [pull_request, push]
defaults:
run:
shell: bash -l {0}
jobs:
build:
name: build
runs-on: self-hosted
strategy:
matrix:
# Use these Java versions
java: [ 21, ] # Current Java LTS & minimum supported by Minecraft
steps:
- name: lock file
run: lockfile /tmp/minecraft-test-lock
- name: checkout vereya
uses: actions/checkout@v3
with:
repository: trueagi-io/Vereya
path: Vereya
clean: false
- name: install vereya
run: rm /home/tester/.minecraft/mods/* ; ls && cd $GITHUB_WORKSPACE/Vereya/ && ./gradlew build && cp $GITHUB_WORKSPACE/Vereya/build/libs/* /home/tester/.minecraft/mods/
- name: install fabric
run: rsync -v $GITHUB_WORKSPACE/Vereya/fabric/* /home/tester/.minecraft/mods/
- name: checkout tagilmo
uses: actions/checkout@v3
with:
repository: trueagi-io/minecraft-demo
clean: false
- name: install tagilmo
run: pwd && conda activate py31 && pip install .
- name: start minecraft
run: cd Vereya && ./launch.sh &
env:
DISPLAY: :99
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
- name: run test
run: |
ps a|grep [j]ava &&
conda activate py31 && cd $GITHUB_WORKSPACE/tests/vereya &&
python run_tests.py
- name: save java logs
if: always()
uses: actions/upload-artifact@v3
with:
name: JavaLogs
path: Vereya/logs/app.log
- name: save python logs
if: always()
uses: actions/upload-artifact@v3
with:
name: PythonLog
path: tests/vereya/app.log
- name: save test observations
uses: actions/upload-artifact@v3
with:
name: TestObservations
path: tests/vereya/observations/observations.txt
- name: cleanup
if: success()
run: rm -r `pwd`/*
- name: remove lock
if: always()
run: rm -f /tmp/minecraft-test-lock