-
Notifications
You must be signed in to change notification settings - Fork 35
136 lines (117 loc) · 4.41 KB
/
continuous-integration.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: build
on:
push:
branches:
- main
- github-actions
- mono
- godot4
pull_request:
branches:
- main
jobs:
test:
name: Build & test
runs-on: ubuntu-22.04
strategy:
matrix:
version:
- "4.2"
- "4.2.1"
flavor:
- "vanilla"
- "mono"
steps:
- name: "(Shared) Check out the repository"
uses: actions/checkout@v2
with:
submodules: 'recursive'
path: 'inkgd'
- name: "(Shared) Install test dependencies"
run: |
sudo apt-get update
sudo apt-get -y install wget zip unzip libxml2-utils
- name: "(Shared) Inject export preset"
run: |
mv inkgd/ci_export_presets.cfg inkgd/export_presets.cfg
- name: "(Vanilla) Install Godot"
if: ${{ matrix.flavor == 'vanilla' }}
env:
VERSION: ${{ matrix.version }}
run: |
wget -q https://downloads.tuxfamily.org/godotengine/${VERSION}/Godot_v${VERSION}-stable_linux.x86_64.zip
unzip Godot_v${VERSION}-stable_linux.x86_64.zip
mv Godot_v${VERSION}-stable_linux.x86_64 godot
chmod +x godot
# This step exports a dummy PCK to force reimportation.
#
# The export is done twice, because it won't import all the required
# assets at first, since inkgd won't run properly at first due to…
# … missing assets.
- name: "(Vanilla) Reimport Assets"
if: ${{ matrix.flavor == 'vanilla' }}
run: |
./godot --headless --path "inkgd" --export-pack "HTML5" dummy.pck
./godot --headless --path "inkgd" --export-pack "HTML5" dummy.pck
- name: "(Vanilla) Run tests"
if: ${{ matrix.flavor == 'vanilla' }}
run: |
./godot --headless -d -s --path "inkgd" "addons/gut/gut_cmdln.gd"
- name: "(Mono) Install Godot"
if: ${{ matrix.flavor == 'mono' }}
env:
VERSION: ${{ matrix.version }}
run: |
wget -q https://downloads.tuxfamily.org/godotengine/${VERSION}/mono/Godot_v${VERSION}-stable_mono_linux_x86_64.zip
unzip Godot_v${VERSION}-stable_mono_linux_x86_64.zip
mv Godot_v${VERSION}-stable_mono_linux_x86_64 godot_mono
mv godot_mono/Godot_v${VERSION}-stable_mono_linux.x86_64 godot_mono/godot_mono
chmod +x godot_mono/godot_mono
- name: "(Mono) Install Ink Runtime"
if: ${{ matrix.flavor == 'mono' }}
run: |
wget -q https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip
unzip inklecate_windows.zip
mv ink-engine-runtime.dll inkgd/addons/inkgd/mono/assemblies/ink-engine-runtime.dll
- name: "(Mono) Patch project file to match version"
if: ${{ matrix.flavor == 'mono' }}
env:
VERSION: ${{ matrix.version }}
run: |
VERSION_COMPONENTS=(${VERSION//./ })
NUMBER_OF_COMPONENTS=${#VERSION_COMPONENTS[@]}
# Assuming that if the number of version components is not 3,
# then it's 2, therefore we add a zero at the end.
if [[ "$NUMBER_OF_COMPONENTS" = "3" ]]; then
SEMANTIC_VERSION="$VERSION"
else
SEMANTIC_VERSION="$VERSION.0"
fi
cd inkgd
xmllint --shell inkgd.csproj <<EOF
cd /Project/@Sdk
set Godot.NET.Sdk/${SEMANTIC_VERSION}
save
EOF
cd ..
- name: "(Mono) Compile C# solution"
if: ${{ matrix.flavor == 'mono' }}
run: |
./godot_mono/godot_mono --headless --quit --path "inkgd"
cd inkgd
dotnet msbuild inkgd.sln /restore /t:Build /p:Configuration=Debug
cd ..
# This step exports a dummy PCK to force reimportation.
#
# The export is done twice, because it won't import all the required
# assets at first, since inkgd won't run properly at first due to…
# … missing assets.
- name: "(Mono) Reimport Assets"
if: ${{ matrix.flavor == 'mono' }}
run: |
./godot_mono/godot_mono --headless --path "inkgd" --export-pack "HTML5" dummy.pck
./godot_mono/godot_mono --headless --path "inkgd" --export-pack "HTML5" dummy.pck
- name: "(Mono) Run tests (Mono)"
if: ${{ matrix.flavor == 'mono' }}
run: |
./godot_mono/godot_mono --headless -d -s --path "inkgd" "addons/gut/gut_cmdln.gd"