-
Notifications
You must be signed in to change notification settings - Fork 17
179 lines (154 loc) · 5.94 KB
/
install_test.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: 🤖 Install Tests
on:
push:
pull_request:
jobs:
install_tests_3x:
name: 🔋 Godot 3.x Integration Tests with ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Only run the workflow if it's not a PR or if it's a PR from a fork.
# This prevents duplicate workflows from running on PR's that originate
# from the repository itself.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
strategy:
# Don't cancel other runners if one fails.
fail-fast: false
matrix:
# Also try windows-2019?
os: [ macos-latest, ubuntu-latest, windows-2019 ]
defaults:
run:
# Use bash shells on all platforms.
shell: bash
steps:
- name: 🧾 Checkout
uses: actions/checkout@v3
- name: 💽 Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
# Use the .NET SDK from global.json in the root of the repository.
global-json-file: global.json
- name: 📦 Restore Dependencies
run: dotnet restore
- name: 🦺 Build Projects
run: dotnet build
- name: 🛣 Add Current Installation To Path
# Gets the last line of the output from the installation and adds it to the path.
working-directory: GodotEnv
run: |
# Use tool to install Godot. Last line of output is the path to the
# symlink that always points to the active version of Godot.
dotnet run -- godot install 3.5.3
- name: 🤖 Check Godot Location
working-directory: GodotEnv
run: |
# Get path to the symlink that always points to the active version of
# Godot.
GODOT_SYMLINK="$(dotnet run -- godot env path)"
# Make sure we can use Godot.
$GODOT_SYMLINK --version
echo "✅ Godot location is in path!"
- name: 🌴 Set GODOT System Environment Variable
working-directory: GodotEnv
run: |
dotnet run -- godot env setup
- name: 🧪 Verify GODOT System Environment Variable
working-directory: GodotEnv
run: |
# Make sure we can retrieve environment variable on all systems.
VERIFY_GODOT=$(dotnet run -- godot env get)
echo "GODOT=$VERIFY_GODOT"
if [ -z "$VERIFY_GODOT" ]; then
echo "❌ GODOT environment variable is empty!"
exit 1
fi
- name: 🗑 Uninstall
working-directory: GodotEnv
run: |
echo "Before uninstall:"
dotnet run -- godot list
echo "Uninstalling..."
dotnet run -- godot uninstall 3.5.3
echo "After uninstall:"
dotnet run -- godot list
install_tests_4x:
name: 🔋 Godot 4.x Integration Tests with ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Only run the workflow if it's not a PR or if it's a PR from a fork.
# This prevents duplicate workflows from running on PR's that originate
# from the repository itself.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
strategy:
# Don't cancel other runners if one fails.
fail-fast: false
matrix:
# Also try windows-2019?
os: [macos-latest, ubuntu-latest, windows-2019]
defaults:
run:
# Use bash shells on all platforms.
shell: bash
steps:
- name: 🧾 Checkout
uses: actions/checkout@v3
- name: 💽 Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
# Use the .NET SDK from global.json in the root of the repository.
global-json-file: global.json
- name: 📦 Restore Dependencies
run: dotnet restore
- name: 🦺 Build Projects
run: dotnet build
- name: 🛣 Add Current Installation To Path
# Gets the last line of the output from the installation and adds it to the path.
working-directory: GodotEnv
run: |
# Use tool to install Godot. Last line of output is the path to the
# symlink that always points to the active version of Godot.
dotnet run -- godot install 4.1.1
- name: 🤖 Check Godot Location
working-directory: GodotEnv
run: |
# Get path to the symlink that always points to the active version of
# Godot.
GODOT_SYMLINK="$(dotnet run -- godot env path)"
# Make sure we can use Godot.
$GODOT_SYMLINK --version
echo "✅ Godot location is in path!"
- name: 🌴 Set GODOT System Environment Variable
working-directory: GodotEnv
run: |
dotnet run -- godot env setup
- name: 🧪 Verify GODOT System Environment Variable
working-directory: GodotEnv
run: |
# Make sure we can retrieve environment variable on all systems.
VERIFY_GODOT=$(dotnet run -- godot env get)
echo "GODOT=$VERIFY_GODOT"
if [ -z "$VERIFY_GODOT" ]; then
echo "❌ GODOT environment variable is empty!"
exit 1
fi
- name: 🧐 Make sure we can build a .NET Godot game
working-directory: TestPackage/TestPackage.Tests
run: |
GODOT="$(dotnet ../../GodotEnv/bin/Debug/net6.0/Chickensoft.GodotEnv.dll godot env get)"
dotnet build
$GODOT --headless --run-tests --quit-on-finish
echo "✅ Built and executed .NET test project."
- name: 🗑 Uninstall
working-directory: GodotEnv
run: |
echo "Before uninstall:"
dotnet run -- godot list
echo "Uninstalling..."
dotnet run -- godot uninstall 4.1.1
echo "After uninstall:"
dotnet run -- godot list