Skip to content

Commit bc88e74

Browse files
committed
Improve test & CI
1 parent 460d523 commit bc88e74

File tree

3 files changed

+124
-73
lines changed

3 files changed

+124
-73
lines changed

.github/workflows/build.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2
26+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
2727
with:
2828
submodules: true
2929
- name: Set up Python
30-
uses: actions/setup-python@0291cefc54fa79cd1986aee8fa5ecb89ad4defea # pin@v2
30+
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # pin@v4.5.0
3131
with:
3232
python-version: ${{ env.PYTHON_VERSION }}
3333
- name: Bootstrap
@@ -51,11 +51,11 @@ jobs:
5151
PLATFORM: linux-x86_64
5252
steps:
5353
- name: 'Checkout'
54-
uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2
54+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
5555
with:
5656
submodules: true
5757
- name: 'Set up Python'
58-
uses: actions/setup-python@0291cefc54fa79cd1986aee8fa5ecb89ad4defea # pin@v2
58+
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # pin@v4.5.0
5959
with:
6060
python-version: ${{ env.PYTHON_VERSION }}
6161
- name: 'Setup venv'
@@ -72,7 +72,10 @@ jobs:
7272
- name: 'Build project'
7373
run: meson compile -C build/
7474
- name: 'Run tests'
75-
run: python tests/run.py 0-gdscript 1-gdextension --build-dir build/ -- --headless
75+
run: |
76+
set -eux
77+
python tests/run.py 0-gdscript --build-dir build/ -- --headless
78+
python tests/run.py 1-gdextension --build-dir build/ -- --headless
7679
# - name: 'Generate artifact archive'
7780
# run: meson compile -C build/ release
7881
# - name: 'Export release artifact'
@@ -94,20 +97,22 @@ jobs:
9497
- PLATFORM: 'windows-x86_64'
9598
PYTHON_ARCH: 'x64'
9699
MSVC_ARCH: 'x64'
100+
GODOT_BINARY_HINT: ''
97101
- PLATFORM: 'windows-x86'
98102
PYTHON_ARCH: 'x86'
99103
MSVC_ARCH: 'x86'
104+
GODOT_BINARY_HINT: 'x86:'
100105
steps:
101106
- name: 'Checkout'
102-
uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2
107+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
103108
with:
104109
submodules: true
105110
- name: 'Set up MSVC'
106111
uses: egor-tensin/vs-shell@9a932a62d05192eae18ca370155cf877eecc2202 # [email protected]
107112
with:
108113
arch: ${{ matrix.MSVC_ARCH }}
109114
- name: 'Set up Python'
110-
uses: actions/setup-python@0291cefc54fa79cd1986aee8fa5ecb89ad4defea # pin@v2
115+
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # pin@v4.5.0
111116
with:
112117
python-version: ${{ env.PYTHON_VERSION }}
113118
architecture: ${{ matrix.PYTHON_ARCH }}
@@ -123,7 +128,11 @@ jobs:
123128
- name: 'Build project'
124129
run: meson compile -C build/
125130
- name: 'Run tests'
126-
run: python tests/run.py 0-gdscript 1-gdextension --build-dir build/ -- --headless
131+
shell: bash
132+
run: |
133+
set -eux
134+
python tests/run.py 0-gdscript --build-dir build/ --godot-binary=${{ matrix.GODOT_BINARY_HINT }} -- --headless
135+
python tests/run.py 1-gdextension --build-dir build/ --godot-binary=${{ matrix.GODOT_BINARY_HINT }} -- --headless
127136
# - name: 'Install Mesa3D OpenGL'
128137
# shell: bash
129138
# run: |
@@ -164,11 +173,11 @@ jobs:
164173
PLATFORM: 'macos-x86_64'
165174
steps:
166175
- name: 'Checkout'
167-
uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2
176+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
168177
with:
169178
submodules: true
170179
- name: 'Set up Python'
171-
uses: actions/setup-python@0291cefc54fa79cd1986aee8fa5ecb89ad4defea # pin@v2
180+
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # pin@v4.5.0
172181
with:
173182
python-version: ${{ env.PYTHON_VERSION }}
174183
- name: 'Setup venv'

tests/1-gdextension/build.py

+11-18
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,26 @@
99

1010
if platform.system() == "Windows":
1111
cmd = ["cl.exe", "/DEBUG", "/LD", "my.c", "/I", str(GODOT_HEADERS_DIR)]
12-
elif platform.system() == "Darwin":
13-
cmd = [
14-
"cc",
15-
"-g",
16-
"-fPIC",
17-
"-shared",
18-
"-c",
19-
"my.c",
20-
"-o",
21-
"my.so",
22-
"-I",
23-
str(GODOT_HEADERS_DIR),
24-
]
12+
print(f"cd {PROJECT_DIR} && " + " ".join(cmd))
13+
subprocess.check_call(cmd, cwd=PROJECT_DIR)
14+
2515
else:
26-
assert platform.system() == "Linux"
16+
assert platform.system() in ("Linux", "Darwin")
17+
2718
cmd = [
2819
"cc",
2920
"-g",
3021
"-fPIC",
31-
"-shared",
3222
"-c",
3323
"my.c",
3424
"-o",
35-
"my.so",
25+
"my.o",
3626
"-I",
3727
str(GODOT_HEADERS_DIR),
3828
]
29+
print(f"cd {PROJECT_DIR} && " + " ".join(cmd))
30+
subprocess.check_call(cmd, cwd=PROJECT_DIR)
3931

40-
print(f"cd {PROJECT_DIR} && " + " ".join(cmd))
41-
subprocess.check_call(cmd, cwd=PROJECT_DIR)
32+
cmd = ["cc", "my.o", "-shared", "-o", "my.so"]
33+
print(f"cd {PROJECT_DIR} && " + " ".join(cmd))
34+
subprocess.check_call(cmd, cwd=PROJECT_DIR)

0 commit comments

Comments
 (0)