forked from shorepine/amy
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (117 loc) · 4.43 KB
/
Copy pathc-cpp.yml
File metadata and controls
148 lines (117 loc) · 4.43 KB
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
name: C/C++ CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install numpy soundfile
# The one Linux job that HAS libasound, so src/linux_midi.c (ALSA raw
# MIDI) is actually compiled somewhere. It is optional and detected,
# so every other Linux job here builds the without-ALSA path -- which
# is the arrangement that keeps both honest.
- name: Install ALSA headers
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
- name: Build and test
env:
AMY_TEST_THRESHOLD_DB: "-70.0"
run: make test
web:
# Build the emscripten / WASM target (`make web`) so breaks there are caught.
# The other CI jobs build the MCU targets and run the Python tests but never
# the browser build, so e.g. a stale `make web` EXPORTED_FUNCTIONS entry
# (exporting a removed symbol) links fine on-device yet fails wasm-ld.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: pip install numpy
- uses: mymindstorm/setup-emsdk@v14
with:
# Pin to the emsdk the web build is developed/deployed against. Newer
# emsdk fails the link with undefined pthread_* symbols under the
# AUDIO_WORKLET / WASM_WORKERS flags make web uses.
version: 4.0.22
- name: Build web (emscripten)
run: make web
godot-api:
# The Godot send() kwarg map in godot/amy.gd is generated from
# amy/__init__.py's _KW_MAP_LIST. Fail the build if a PR changed the Python
# source without regenerating (so Godot can't silently drift like it did
# before), and confirm the generated GDScript still parses.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install gdtoolkit (gdparse)
run: pip install "gdtoolkit==4.*"
- name: Regenerate Godot API map
run: make godot-api
- name: Validate GDScript parses
run: gdparse godot/amy.gd
- name: Check godot/amy.gd is in sync with amy/__init__.py
run: |
if ! git diff --quiet -- godot/amy.gd; then
echo "::error::godot/amy.gd is out of sync with amy/__init__.py _KW_MAP_LIST. Run 'make godot-api' and commit the result."
git diff -- godot/amy.gd
exit 1
fi
c-api:
# The cross-platform C API bindings (pyamy/micropython/web/godot .inc + .js
# files, the amy/__init__.py dispatch block, and godot/amy.gd's C API
# section) are generated from the table in scripts/gen_amy_c_api.py. Fail
# the build if a PR edited the table (or a generated file) without
# regenerating, so the four platforms can't drift.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Check generated C API bindings are in sync
run: make check-c-api
godot-build:
# Build the Godot GDExtension for Linux. amy_midi.c is excluded from the
# Godot build, so new functions there that core code calls need stubs in
# godot/src/amy_platform_stubs.c — without this job that only surfaces as a
# Windows link failure at release time (which silently ships releases with
# no addon zip). The SConstruct links Linux with -Wl,--no-undefined so the
# same unresolved symbols fail here, on the PR.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install scons
run: pip install scons
- name: Checkout godot-cpp
uses: actions/checkout@v4
with:
repository: godotengine/godot-cpp
ref: godot-4.4-stable
path: godot-cpp
submodules: true
- name: Build GDExtension (Linux debug)
working-directory: godot
run: scons platform=linux arch=x86_64 target=template_debug -j4
env:
GODOT_CPP_PATH: ${{ github.workspace }}/godot-cpp
AMY_SRC_PATH: ${{ github.workspace }}/src