Update test.yml #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: build and test | |
on: | |
- pull_request | |
- push | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build: | |
name: build | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
java: | |
- 21 | |
steps: | |
- name: lock file | |
run: lockfile /tmp/minecraft-test-lock | |
- name: checkout vereya | |
uses: actions/checkout@v3 | |
with: | |
repository: trueagi-io/Vereya | |
path: Vereya | |
ref: server | |
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/ && | |
mkdir $GITHUB_WORKSPACE/Vereya/server/mods/ ; | |
cp $GITHUB_WORKSPACE/Vereya/build/libs/* $GITHUB_WORKSPACE/Vereya/server/mods/ | |
- name: install fabric | |
run: rsync -v $GITHUB_WORKSPACE/Vereya/fabric/* /home/tester/.minecraft/mods/ && | |
cp $GITHUB_WORKSPACE/Vereya/fabric/* $GITHUB_WORKSPACE/Vereya/server/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: start minecraft server | |
run: cd Vereya/server && ./launch.sh & | |
env: | |
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 |