-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.94 KB
/
e2e.yaml
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
name: End to End Test
on:
push: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo build --release --locked
- uses: actions/upload-artifact@v4
with:
name: binary
path: target/release/mrpack-container
e2e:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
mrpackfile: [quilt-simple.mrpack, fabric-simple.mrpack]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: binary
path: /usr/local/bin
merge-multiple: true
- name: Install mrpack-container
run: chmod +x /usr/local/bin/mrpack-container
- name: Build Container
run: mrpack-container --output ./output "tests/mrpacks/${{ matrix.mrpackfile }}"
- name: Run Container
run: |
wget --no-verbose "https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar"
container_id=$(tar cf - -C ./output . | podman load | awk '{ print $3 }')
mkdir /tmp/world
chmod a+rwx /tmp/world
echo "eula=true" > eula.txt
podman run \
--detach \
--publish 25565:25565 \
--volume /tmp/world:/var/minecraft/world \
--volume "$(pwd)"/server.jar:/usr/local/minecraft/server.jar:ro \
--volume "$(pwd)"/eula.txt:/var/minecraft/eula.txt:ro \
"$container_id" > running_container_id
- name: Verify Container is hosting a Minecraft Server
run: |
python3 -m pip install mcstatus
sleep 60
podman logs $(cat running_container_id)
mcstatus localhost status
- name: Verify world save
run: |
if [ -f /tmp/world/level.dat ]; then
echo "Level file found in expected location"
else
echo "Level file not found!"
false
fi