aboutsummaryrefslogtreecommitdiff
path: root/.build.yml
blob: af6b8bb4d16a7c2dfbf33e55cb54e97e5fd5e38c (plain)
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
74
75
76
image: debian/stable
packages: 
- git
- curl
- minetest-server
- unzip
- wget
- lua-busted
- dvisvgm
- ghostscript
- texlive-extra-utils
- texlive-latex-base
- texlive-latex-extra
- texlive-fonts-extra
- texlive-pictures
- texlive-science
- tidy
sources :
- https://git.sr.ht/~gpcf/advtrains
artifacts:
- .minetest/mods/advtrains/assets/manual/acceleration-distance.pdf
- .minetest/mods/advtrains/assets/manual/manual.pdf
- .minetest/mods/advtrains/assets/manual/a5manual.pdf
- .minetest/mods/advtrains/assets/manuals.tar.xz

tasks:

- download_mt_server: |
    mkdir bin
    wget https://lifomaps.de/advtrains-test/builtin.tar.gz
    tar xf builtin.tar.gz
    curl https://lifomaps.de/advtrains-test/minetestserver -o ~/bin/minetestserver
    chmod +x ~/bin/minetestserver
- install_mt_game : |
    curl -L https://github.com/minetest/minetest_game/archive/refs/tags/5.5.0.zip -o minetest_game.zip
    mkdir -p .minetest/games/
    cd .minetest/games
    unzip ../../minetest_game.zip
    mv minetest_game-5.5.0 minetest_game
- install_test_world: |
    mkdir -p .minetest/worlds/
    curl https://lifomaps.de/advtrains-test/testworld.tar.gz -o ~/testworld.tar.gz
    cd .minetest/worlds/
    tar xf ../../testworld.tar.gz
- run_unit_tests : |
    cd advtrains/advtrains
    busted
    cd ../advtrains_interlocking
    busted
    cd ../serialize_lib
    busted
- activate_test_env: |
    cd advtrains
    git merge --no-commit origin/luaatcdebug
- install_advtrains : |
    mkdir .minetest/mods
    cp -r advtrains .minetest/mods
    cd .minetest/mods
    git clone https://git.bananach.space/basic_trains.git/
- run_test_world: | 
    echo "bind_address = 127.0.0.1" > minetest.conf
    ~/bin/minetestserver --port 31111 --gameid minetest_game --config ~/minetest.conf --world ~/.minetest/worlds/advtrains_testworld
- generate_documentation: |
    cd ~/.minetest/mods/advtrains/assets/manual
    sed -E '5s/a4paper/a5paper/' manual.tex > a5manual.tex
    for i in manual.tex a5manual.tex; do
        for run in {1..2}; do
            pdflatex -interaction=nonstopmode -halt-on-error -output-format=pdf $i
        done
    done
    make4ht -f 'html5+tidy' manual.tex
    for i in acceleration-distance.ps; do
        ps2pdf $i
    done
    cd ..
    find ./manual -name '*.pdf' -o -name '*.svg' -o -name '*.html' -o -name '*.css' | tar -cJf manuals.tar.xz -T -